Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: fixup bq _partitions_match for range partitions #2156

Merged
merged 2 commits into from
Feb 26, 2020

Conversation

jtcohen6
Copy link
Contributor

Fixup to #2140

The issue is just a matter of matching the structure of the object in the BQ API.

Steps to replicate

Running with dbt 0.16.0, create a model that is partitioned by an integer range. Change the partitioning spec and run --full-refresh.

First error:

AttributeError: 'Table' object has no attribute 'range_partition'


It's called range_partitioning

Second error:

AttributeError: 'PartitionRange' object has no attribute 'field'

The field key is nested under range_partitioning, rather than under range_partitioning.range_

@jtcohen6 jtcohen6 requested a review from beckjake February 25, 2020 15:19
@cla-bot cla-bot bot added the cla:yes label Feb 25, 2020
Copy link
Contributor

@beckjake beckjake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix looks great, but can you add an integration test that exercises this path so we don't regress? I'm happy to help with that - I can't remember if you've written dbt integration tests before.

@jtcohen6
Copy link
Contributor Author

Surely. I added a test to TestChangingPartitions, which seemed most relevant.

Copy link
Contributor

@beckjake beckjake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks for the test! - I've verified that the test correctly fails without this fix, so hopefully no more regressions.

@jtcohen6 jtcohen6 merged commit 40c07af into dev/barbara-gittings Feb 26, 2020
@jtcohen6 jtcohen6 deleted the fix/bq-range-part-match branch February 26, 2020 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants