Repository navigation
Fix nightly ingestion integration tests and a flaky Alation sink unit test - #37097
Conversation
…and BigQuery usage resolution - ometa workflow fixture: set MysqlConnection.type explicitly. The dump excludes unset fields, so without the discriminator the untagged DatabaseConnection union resolved to TrinoConnection once Trino gained default filter patterns (#36677). - test_sample_usage: sample_data is a BigQuery service, and BigQuery usage resolution (#36867) rewrites references to database.schema.table, so expect those keys. Assert the whole map so a miss shows what was found.
…onic Patching `client.time.monotonic` replaces the attribute on the shared `time` module, so any background thread (a leftover pymongo cursor reaper on the 3.10 unit job) consumed the fake ticks; the exhausted iterator raised StopIteration, which _write_batch reported as an empty error. Patch the client module's `time` binding instead.
Code Review ✅ Approved🟢 Low risk · Changes are confined to ingestion test fixtures, expected usage keys, and clock mocking, with no production code or interfaces changed. Fixes nightly ingestion integration tests by setting VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|



Describe your changes:
Fixes the nightly
py-cli-e2e-testsfailures in run 41938450661: the two setup errors inometa/test_ometa_ingestion_pipeline.pyand the failure inusage/test_sample_usage.py::QueryParserTest::test_join_count.ometa
workflowfixture. The fixture builds aMysqlConnectionwithouttype, andmodel_dump_jsondrops unset fields. That leaves the untaggedDatabaseConnectionunion with no discriminator. Since Fixes 36674: Add default system-schema filters for database connectors #36677 gave Trino default filter patterns, the union resolves toTrinoConnection, soMysqlSource.createraisesExpected MysqlConnection, but got type=Trino. The fix setstype=MySQLType.Mysql. This only affects tests: real connection JSON always carriestype, and Trino rejects"Mysql".test_sample_usage.sample_datais a BigQuery service. Since Fixes 16640: Add stable BigQuery shard families #36867, BigQuery usage resolution (prepare_usage) rewrites each table reference to the matched table's FQN without the service prefix, so stage keys are nowecommerce_db.shopify.<table>. The expected keys are updated and the counts are unchanged. The test now asserts the whole map, so a miss reports what was found instead ofFalse is not true.Flaky
alationsink/test_client.pyclock tests (failed this PR's 3.10 unit job).patch("…client.time.monotonic")replaces the attribute on the globaltimemodule. A leftover pymongo background thread then used up the fake clock ticks, and the resultingStopIterationsurfaced as an empty error string. The tests now patch only the client module'stimebinding.Type of change:
High-level design:
N/A — test-only fix to two files.
Tests:
Use cases covered
MysqlConnection.sample_dataservice counts usage under resolved table names.Unit tests
tests/unit/source/metadata/alationsink/: 18 passed.time.monotonic()throughout, the old file failed 3/3 runs with CI's signature and the fixed file passed 3/3.Backend integration tests
Ingestion integration tests
ingestion/tests/integration/ometa/conftest.py,ingestion/tests/integration/usage/test_sample_usage.pyMysqlConnectionthroughWorkflowSourcegivesTrinoConnectionwithouttypeandMysqlConnectionwith it.sample_dataquery log throughparse_sql_statementandBigQueryTableBindingResolution.prepare_usage(catalog search stubbed) gives exactly the new expected map,{raw_product_catalog: 6, dim_customer: 4, fact_order: 4, fact_sale: 5, raw_customer: 11}underecommerce_db.shopify..Playwright (UI) tests
Manual testing performed
ruff checkandruff format --checkpass on both files.UI screen recording:
Not applicable — test-only change.
Checklist:
Fixes <issue-number>: <short explanation>— N/A, test fix with no issue (skip-pr-checks).Fixes #<issue-number>above. — N/A, test fix.REVIEW.mdand fixed every 🔴 finding, or answered it on the line below.f4c6f2d0626; no 🔴 findings.🤖 Generated with Claude Code