René's URL Explorer Experiment


Title: Entity SQL does not work as documented with PostgreSQL Offline Store · Issue #5605 · feast-dev/feast · GitHub

Open Graph Title: Entity SQL does not work as documented with PostgreSQL Offline Store · Issue #5605 · feast-dev/feast

X Title: Entity SQL does not work as documented with PostgreSQL Offline Store · Issue #5605 · feast-dev/feast

Description: Expected Behavior Entity SQL as documented in Example: entity SQL query for generating training data works. entity_sql = f""" SELECT entity_id, event_timestamp FROM {feature_store.get_data_source("customer_credit_risk_feature_source").ge...

Open Graph Description: Expected Behavior Entity SQL as documented in Example: entity SQL query for generating training data works. entity_sql = f""" SELECT entity_id, event_timestamp FROM {feature_store.get_data_source("...

X Description: Expected Behavior Entity SQL as documented in Example: entity SQL query for generating training data works. entity_sql = f""" SELECT entity_id, event_timestamp FROM {feature_store.ge...

Opengraph URL: https://github.com/feast-dev/feast/issues/5605

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Entity SQL does not work as documented with PostgreSQL Offline Store","articleBody":"## Expected Behavior \n\nEntity SQL as documented in [Example: entity SQL query for generating training data\n](https://docs.feast.dev/getting-started/concepts/feature-retrieval?q=PostgreSQLSource#example-entity-sql-query-for-generating-training-data) works.\n\n```\nentity_sql = f\"\"\"\n    SELECT\n        entity_id,\n        event_timestamp\n    FROM {feature_store.get_data_source(\"customer_credit_risk_feature_source\").get_table_query_string()} \n\"\"\"\nprint(entity_sql)\n-----\n    SELECT\n        entity_id,\n        event_timestamp\n    FROM (SELECT * FROM credit.customer_credit_risk_features) \n```\n```\ntraining_df = feature_store.get_historical_features(\n    entity_df=entity_sql,\n    features=customer_credit_risk_features,\n).to_df()\n```\n\n\n## Current Behavior\n\n```\n---------------------------------------------------------------------------\nSyntaxError                               Traceback (most recent call last)\nFile ~/venv/feast/lib/python3.11/site-packages/pandas/io/sql.py:2664, in SQLiteDatabase.execute(self, sql, params)\n   2663 try:\n-\u003e 2664     cur.execute(sql, *args)\n   2665     return cur\n\nFile ~/venv/feast/lib/python3.11/site-packages/psycopg/cursor.py:97, in Cursor.execute(self, query, params, prepare, binary)\n     96 except e._NO_TRACEBACK as ex:\n---\u003e 97     raise ex.with_traceback(None)\n     98 return self\n\nSyntaxError: subquery in FROM must have an alias\nLINE 5:     FROM (SELECT * FROM credit.customer_credit_risk_features...\n                 ^\nHINT:  For example, FROM (SELECT ...) [AS] foo.\n\nThe above exception was the direct cause of the following exception:\n\nDatabaseError                             Traceback (most recent call last)\nCell In[55], line 1\n----\u003e 1 training_df = feature_store.get_historical_features(\n      2     entity_df=entity_sql,\n      3     features=customer_credit_risk_features,\n      4 ).to_df()\n\nFile ~/venv/feast/lib/python3.11/site-packages/feast/feature_store.py:1207, in FeatureStore.get_historical_features(self, entity_df, features, full_feature_names, start_date, end_date)\n   1204 if end_date is not None:\n   1205     kwargs[\"end_date\"] = end_date\n-\u003e 1207 job = provider.get_historical_features(\n   1208     self.config,\n   1209     feature_views,\n   1210     _feature_refs,\n   1211     entity_df,\n   1212     self._registry,\n   1213     self.project,\n   1214     full_feature_names,\n   1215     **kwargs,\n   1216 )\n   1218 return job\n\nFile ~/venv/feast/lib/python3.11/site-packages/feast/infra/passthrough_provider.py:467, in PassthroughProvider.get_historical_features(self, config, feature_views, feature_refs, entity_df, registry, project, full_feature_names, **kwargs)\n    456 def get_historical_features(\n    457     self,\n    458     config: RepoConfig,\n   (...)    465     **kwargs,\n    466 ) -\u003e RetrievalJob:\n--\u003e 467     job = self.offline_store.get_historical_features(\n    468         config=config,\n    469         feature_views=feature_views,\n    470         feature_refs=feature_refs,\n    471         entity_df=entity_df,\n    472         registry=registry,\n    473         project=project,\n    474         full_feature_names=full_feature_names,\n    475         **kwargs,\n    476     )\n    478     return job\n\nFile ~/venv/feast/lib/python3.11/site-packages/feast/infra/offline_stores/contrib/postgres_offline_store/postgres.py:170, in PostgreSQLOfflineStore.get_historical_features(config, feature_views, feature_refs, entity_df, registry, project, full_feature_names, **kwargs)\n    160         start_date = make_tzaware(start_date)\n    162     entity_df = pd.DataFrame(\n    163         {\n    164             \"event_timestamp\": pd.date_range(\n   (...)    167         }\n    168     )\n--\u003e 170 entity_schema = _get_entity_schema(entity_df, config)\n    172 entity_df_event_timestamp_col = (\n    173     offline_utils.infer_event_timestamp_from_entity_df(entity_schema)\n    174 )\n    176 entity_df_event_timestamp_range = _get_entity_df_event_timestamp_range(\n    177     entity_df,\n    178     entity_df_event_timestamp_col,\n    179     config,\n    180 )\n\nFile ~/venv/feast/lib/python3.11/site-packages/feast/infra/offline_stores/contrib/postgres_offline_store/postgres.py:503, in _get_entity_schema(entity_df, config)\n    501 elif isinstance(entity_df, str):\n    502     df_query = f\"({entity_df}) AS sub\"\n--\u003e 503     return get_query_schema(config.offline_store, df_query)\n    504 else:\n    505     raise InvalidEntityType(type(entity_df))\n\nFile ~/venv/feast/lib/python3.11/site-packages/feast/infra/utils/postgres/connection_utils.py:116, in get_query_schema(config, sql_query)\n    114 with _get_conn(config) as conn:\n    115     conn.read_only = True\n--\u003e 116     df = pd.read_sql(\n    117         f\"SELECT * FROM {sql_query} LIMIT 0\",\n    118         conn,\n    119     )\n    120     return dict(zip(df.columns, df.dtypes))\n\nFile ~/venv/feast/lib/python3.11/site-packages/pandas/io/sql.py:708, in read_sql(sql, con, index_col, coerce_float, params, parse_dates, columns, chunksize, dtype_backend, dtype)\n    706 with pandasSQL_builder(con) as pandas_sql:\n    707     if isinstance(pandas_sql, SQLiteDatabase):\n--\u003e 708         return pandas_sql.read_query(\n    709             sql,\n    710             index_col=index_col,\n    711             params=params,\n    712             coerce_float=coerce_float,\n    713             parse_dates=parse_dates,\n    714             chunksize=chunksize,\n    715             dtype_backend=dtype_backend,\n    716             dtype=dtype,\n    717         )\n    719     try:\n    720         _is_table_name = pandas_sql.has_table(sql)\n\nFile ~/venv/feast/lib/python3.11/site-packages/pandas/io/sql.py:2728, in SQLiteDatabase.read_query(self, sql, index_col, coerce_float, parse_dates, params, chunksize, dtype, dtype_backend)\n   2717 def read_query(\n   2718     self,\n   2719     sql,\n   (...)   2726     dtype_backend: DtypeBackend | Literal[\"numpy\"] = \"numpy\",\n   2727 ) -\u003e DataFrame | Iterator[DataFrame]:\n-\u003e 2728     cursor = self.execute(sql, params)\n   2729     columns = [col_desc[0] for col_desc in cursor.description]\n   2731     if chunksize is not None:\n\nFile ~/venv/feast/lib/python3.11/site-packages/pandas/io/sql.py:2676, in SQLiteDatabase.execute(self, sql, params)\n   2673     raise ex from inner_exc\n   2675 ex = DatabaseError(f\"Execution failed on sql '{sql}': {exc}\")\n-\u003e 2676 raise ex from exc\n\nDatabaseError: Execution failed on sql 'SELECT * FROM (\n    SELECT\n        entity_id,\n        event_timestamp\n    FROM (SELECT * FROM credit.customer_credit_risk_features) \n) AS sub LIMIT 0': subquery in FROM must have an alias\nLINE 5:     FROM (SELECT * FROM credit.customer_credit_risk_features...\n                 ^\nHINT:  For example, FROM (SELECT ...) [AS] foo.\n```\n\n## Steps to reproduce\n\n### Specifications\n\n- Version: 0.53\n- Platform: MacOSX\n- Subsystem: Python 3.11\n\n## Possible Solution\n\n```\nentity_sql = f\"\"\"\n    SELECT\n        entity_id,\n        event_timestamp\n    FROM {feature_store.get_data_source(\"customer_credit_risk_feature_source\").get_table_query_string()} AS ENTITY_SQL\n\"\"\"\nprint(entity_sql)\n```\n\n","author":{"url":"https://github.com/oonisim","@type":"Person","name":"oonisim"},"datePublished":"2025-09-10T07:10:26.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/5605/feast/issues/5605"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:88c8a6b0-5396-b880-21f5-8c34313c9e70
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD76A:2A7CEE:937D546:C328953:696E03BC
html-safe-noncec2f307c3c7e272665addb4fa0cb4665f0f8e2d987bc1f0321f0e5b1545c3c30b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENzZBOjJBN0NFRTo5MzdENTQ2OkMzMjg5NTM6Njk2RTAzQkMiLCJ2aXNpdG9yX2lkIjoiMTMzMDgzOTIyODI3MTgzMDM2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacef2dcb2bcd15753bbba0169cadac4163a5aa24dd3ce2d9b79f643eee67e116a7
hovercard-subject-tagissue:3401210414
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/feast-dev/feast/5605/issue_layout
twitter:imagehttps://opengraph.githubassets.com/59811d90f8c9be36c5b554366e7b4bc170a48589aaaf6372e5e618c5c31a7ae1/feast-dev/feast/issues/5605
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/59811d90f8c9be36c5b554366e7b4bc170a48589aaaf6372e5e618c5c31a7ae1/feast-dev/feast/issues/5605
og:image:altExpected Behavior Entity SQL as documented in Example: entity SQL query for generating training data works. entity_sql = f""" SELECT entity_id, event_timestamp FROM {feature_store.get_data_source("...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameoonisim
hostnamegithub.com
expected-hostnamegithub.com
None9b5131b207ddd175abf059a848d5f4302ec0606b02211b989013be49cf08593e
turbo-cache-controlno-preview
go-importgithub.com/feast-dev/feast git https://github.com/feast-dev/feast.git
octolytics-dimension-user_id57027613
octolytics-dimension-user_loginfeast-dev
octolytics-dimension-repository_id161133770
octolytics-dimension-repository_nwofeast-dev/feast
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id161133770
octolytics-dimension-repository_network_root_nwofeast-dev/feast
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef8590a63bfc8093b241930ca57d536c9a50f9680
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/feast-dev/feast/issues/5605#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffeast-dev%2Ffeast%2Fissues%2F5605
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffeast-dev%2Ffeast%2Fissues%2F5605
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=feast-dev%2Ffeast
Reloadhttps://github.com/feast-dev/feast/issues/5605
Reloadhttps://github.com/feast-dev/feast/issues/5605
Reloadhttps://github.com/feast-dev/feast/issues/5605
feast-dev https://github.com/feast-dev
feasthttps://github.com/feast-dev/feast
Notifications https://github.com/login?return_to=%2Ffeast-dev%2Ffeast
Fork 1.2k https://github.com/login?return_to=%2Ffeast-dev%2Ffeast
Star 6.6k https://github.com/login?return_to=%2Ffeast-dev%2Ffeast
Code https://github.com/feast-dev/feast
Issues 176 https://github.com/feast-dev/feast/issues
Pull requests 58 https://github.com/feast-dev/feast/pulls
Discussions https://github.com/feast-dev/feast/discussions
Actions https://github.com/feast-dev/feast/actions
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/feast-dev/feast/security
Please reload this pagehttps://github.com/feast-dev/feast/issues/5605
Insights https://github.com/feast-dev/feast/pulse
Code https://github.com/feast-dev/feast
Issues https://github.com/feast-dev/feast/issues
Pull requests https://github.com/feast-dev/feast/pulls
Discussions https://github.com/feast-dev/feast/discussions
Actions https://github.com/feast-dev/feast/actions
Security https://github.com/feast-dev/feast/security
Insights https://github.com/feast-dev/feast/pulse
New issuehttps://github.com/login?return_to=https://github.com/feast-dev/feast/issues/5605
New issuehttps://github.com/login?return_to=https://github.com/feast-dev/feast/issues/5605
#5811https://github.com/feast-dev/feast/pull/5811
Entity SQL does not work as documented with PostgreSQL Offline Storehttps://github.com/feast-dev/feast/issues/5605#top
#5811https://github.com/feast-dev/feast/pull/5811
kind/bughttps://github.com/feast-dev/feast/issues?q=state%3Aopen%20label%3A%22kind%2Fbug%22
priority/p2https://github.com/feast-dev/feast/issues?q=state%3Aopen%20label%3A%22priority%2Fp2%22
https://github.com/oonisim
https://github.com/oonisim
oonisimhttps://github.com/oonisim
on Sep 10, 2025https://github.com/feast-dev/feast/issues/5605#issue-3401210414
Example: entity SQL query for generating training data https://docs.feast.dev/getting-started/concepts/feature-retrieval?q=PostgreSQLSource#example-entity-sql-query-for-generating-training-data
kind/bughttps://github.com/feast-dev/feast/issues?q=state%3Aopen%20label%3A%22kind%2Fbug%22
priority/p2https://github.com/feast-dev/feast/issues?q=state%3Aopen%20label%3A%22priority%2Fp2%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.