Skip to content

Feat!: Allow opting out of the time_column being automatically added to the partitioned_by columns#3941

Merged
erindru merged 1 commit intomainfrom
erin/optional-partition-by-time-column
Mar 5, 2025
Merged

Feat!: Allow opting out of the time_column being automatically added to the partitioned_by columns#3941
erindru merged 1 commit intomainfrom
erin/optional-partition-by-time-column

Conversation

@erindru
Copy link
Collaborator

@erindru erindru commented Mar 4, 2025

Currently, if you have a model something like:

kind INCREMENTAL_BY_TIME_RANGE (
   time_column ds
)

Then the ds column would be automatically added to the partitioned_by columns whether you wanted it to or not.

This PR allows you to opt-out with the following syntax:

kind INCREMENTAL_BY_TIME_RANGE (
   time_column ds,
   partition_by_time_column false
)

(the default is true to keep the existing behaviour)

# This allows the user to opt out of automatic time_column injection
# by setting `partition_by_time_column false` on the model kind
if (
hasattr(self.kind, "partition_by_time_column")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note that this is deliberately a hasattr check so I can utilize this property on a custom materialization

@erindru erindru changed the title Feat: Allow opting out of the time_column being automatically added to the partitioned_by columns Feat!: Allow opting out of the time_column being automatically added to the partitioned_by columns Mar 4, 2025
@erindru erindru merged commit 3653541 into main Mar 5, 2025
22 checks passed
@erindru erindru deleted the erin/optional-partition-by-time-column branch March 5, 2025 19:25
afzaljasani pushed a commit that referenced this pull request Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants