Title: BigQuerySource.get_table_query_string() silently ignores query when table is also set · Issue #6200 · feast-dev/feast · GitHub
Open Graph Title: BigQuerySource.get_table_query_string() silently ignores query when table is also set · Issue #6200 · feast-dev/feast
X Title: BigQuerySource.get_table_query_string() silently ignores query when table is also set · Issue #6200 · feast-dev/feast
Description: Summary When both table and query are provided to BigQuerySource, get_table_query_string() always returns table, silently ignoring query. This makes it impossible to use a custom query (e.g., for deduplication) on a PushSource batch sour...
Open Graph Description: Summary When both table and query are provided to BigQuerySource, get_table_query_string() always returns table, silently ignoring query. This makes it impossible to use a custom query (e.g., for d...
X Description: Summary When both table and query are provided to BigQuerySource, get_table_query_string() always returns table, silently ignoring query. This makes it impossible to use a custom query (e.g., for d...
Opengraph URL: https://github.com/feast-dev/feast/issues/6200
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"BigQuerySource.get_table_query_string() silently ignores query when table is also set","articleBody":"## Summary\n\nWhen both `table` and `query` are provided to `BigQuerySource`, `get_table_query_string()` always returns `table`, silently ignoring `query`. This makes it impossible to use a custom query (e.g., for deduplication) on a `PushSource` batch source, since `PushSource` requires `table` for offline writes via `offline_write_batch()`.\n\n## Expected Behavior\n\nWhen both `table` and `query` are set on a `BigQuerySource`:\n- **Reads** (`get_table_query_string()`) should use `query` — it's more specific and intentionally provided\n- **Writes** (`offline_write_batch()`) should continue using `.table` directly as the write destination\n\n## Current Behavior\n\n`get_table_query_string()` in `bigquery_source.py` always prefers `table`:\n\n```python\ndef get_table_query_string(self) -\u003e str:\n if self.table:\n return f\"`{self.table}`\"\n return f\"({self.query})\"\n```\n\nThis means any custom `query` (e.g., deduplication logic) is silently ignored when `table` is also present.\n\n## Use Case\n\nStreaming (push) sources often produce duplicate rows in BigQuery. The natural solution is:\n\n```python\nbatch_source = BigQuerySource(\n name=\"my_batch_source\",\n table=\"project.dataset.my_table\", # needed for push writes\n query=\"\"\"\n SELECT * FROM `project.dataset.my_table`\n QUALIFY ROW_NUMBER() OVER (PARTITION BY entity_id, event_time) = 1\n \"\"\", # needed for deduplicated reads\n timestamp_field=\"event_time\",\n)\npush_source = PushSource(name=\"my_source\", batch_source=batch_source)\n```\n\nBut because `get_table_query_string()` ignores `query` when `table` is set, reads return duplicates. And removing `table` to force `query` usage breaks `offline_write_batch()`, which accesses `.table` directly (`bigquery.py:449`).\n\n## Environment\n\n- Feast version: 0.58.0 (also confirmed unresolved on 0.61.0 / current main)\n- Offline store: BigQuery","author":{"url":"https://github.com/max36067","@type":"Person","name":"max36067"},"datePublished":"2026-03-31T07:50:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/6200/feast/issues/6200"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:80ca9cd4-8f06-fb46-d55c-f5039e624df4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B976:2C2A02:5F9ABF7:866CC6F:6A4FFE07 |
| html-safe-nonce | c5b4206dc971ac4ac7d61dc9c46ad6cede9aea3009560975b97605d8161264c2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOTc2OjJDMkEwMjo1RjlBQkY3Ojg2NkNDNkY6NkE0RkZFMDciLCJ2aXNpdG9yX2lkIjoiMjIzNjQzMzMyODcyMTg4NjcyNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ac2ed567550e1a08ac6f7772cb6ac584066576544863ac326e11697ec19c1017 |
| hovercard-subject-tag | issue:4176862095 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/feast-dev/feast/6200/issue_layout |
| twitter:image | https://opengraph.githubassets.com/91a60f5647d7ebffefd75fcc7e18eba20a96ca671f4eb42ff8a988d6b043ce4c/feast-dev/feast/issues/6200 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/91a60f5647d7ebffefd75fcc7e18eba20a96ca671f4eb42ff8a988d6b043ce4c/feast-dev/feast/issues/6200 |
| og:image:alt | Summary When both table and query are provided to BigQuerySource, get_table_query_string() always returns table, silently ignoring query. This makes it impossible to use a custom query (e.g., for d... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | max36067 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 56eec25a3430492dd6ec2a480eb33256a0da5192d5714b0db4f5ab5f33203d94 |
| turbo-cache-control | no-preview |
| go-import | github.com/feast-dev/feast git https://github.com/feast-dev/feast.git |
| octolytics-dimension-user_id | 57027613 |
| octolytics-dimension-user_login | feast-dev |
| octolytics-dimension-repository_id | 161133770 |
| octolytics-dimension-repository_nwo | feast-dev/feast |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 161133770 |
| octolytics-dimension-repository_network_root_nwo | feast-dev/feast |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e155b8a71f9284454f73118dfe5e634e74f7afb3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width