[Bug] docs generate
appears to be returning no table metadata when run with the --no-compile
option
#1216
Labels
bug
Something isn't working
High Severity
bug with significant impact that should be resolved in a reasonable timeframe
Current Behavior
Starting on the evening of 4/29/2024,
TestDocsGenerateBigQuery
is failing across all versions ofdbt-bigquery
. For1.7.latest
andmain
,test_run_and_generate
is passing andtest_run_and_generate_no_compile
is failing. For1.6.latest
and prior, both are failing.Failed test runs can be seen here, passing previously and then failing across the board.
Expected Behavior
We should be able to run
docs generate --no-compile
.Steps To Reproduce
For each release branch, I chose a bundle from
dbt-core-bundles
and took thebundle_requirements_mac_3.8.txt
file and used it as a constraints file fordbt-bigquery
. I needed to unpinpytz
because it was pinned in both the constraints file anddev-requirements.txt
. Since the constraints file reflects what would actually get shipped, I chose to unpin indev-requirements.txt
.Taking
1.7.latest
as an example:1.7.55
pytz~=2023.3
indev-requirements.txt
topytz
pip install -e . -r dev-requirements.txt -c bundle_requirements_mac_3.8.txt
pytest tests/functional/adapter/test_basic.py -k "TestDocsGenerateBigQuery"
test_run_and_generate_no_compile
fails andtest_run_and_generate
passes for1.7.latest
and1.8.0b1
or fails as wellHere is a summary of each scenario for each release branch:
main
main
1.7.latest
1.7.55
1.6.latest
1.6.72
1.5.latest
1.5.78
1.4.latest
1.4.64
1.3.latest
1.3.71
Relevant log output
Environment
Additional Context
This is able to be reproduced using a constraint file of hard pins that pre-dates the integration test failures. This suggests the change that caused the issue is not in
dbt-bigquery
nor its dependencies. It's either an OS thing (unlikely since it's across platforms) or a change in BigQuery itself.We were relying on
INFORMATION_SCHEMA.__TABLES__
in the catalog query, which is not recommended. However, fixing that seemed to still generate the same error.Since we see a change in behavior between
1.6
and1.7
, it's worth looking at the diff there for bothdbt-bigquery
anddbt-core
, keeping in mind that it's a change that affects runs without--no-compile
, but not with--no-compile
.While debugging, I found that the
--no-compile
route ran throughBigQueryAdapter._get_catalog_schemas
but notBigQueryAdapter._catalog_filter_table
, perhaps because it failed before getting to the latter? However, when--no-compile
was not used,BigQueryAdapter._get_catalog_schemas
was never used andBigQueryAdapter._catalog_filter_table
was used. In the--no-compile
scenario,BigQueryAdapter._get_catalog_schemas
received two candidate schemas, which feels odd since there should be a single test schema.It's worth noting we have 10,249 schemas in the database. We should probably drop all of the
test#######_test_%
schemas to make sure we're not seeing something funny because of that.I think it's pagination because we broke 10K schemas, and not a functional bug. If so, we still should look at what happens when we're in a database with 10K schemas as we're not properly handling that scenario.
The text was updated successfully, but these errors were encountered: