Skip to content

Commit c61aa3b

Browse files
fix: need to pass partition_column through from the helper method (#649)
## Summary - Need to plumb `partition_column` through. ## Checklist - [ ] Added Unit Tests - [ ] Covered by existing CI - [ ] Integration tested - [ ] Documentation update <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added support for an optional partition column parameter in query operations. <!-- end of auto-generated comment: release notes by coderabbit.ai --> <!-- av pr metadata This information is embedded by the av CLI when creating PRs to track the status of stacks when using Aviator. Please do not delete or edit this section of the PR. ``` {"parent":"main","parentHead":"","trunk":"main"} ``` --> --------- Co-authored-by: Thomas Chow <[email protected]>
1 parent 7ab3c3b commit c61aa3b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

api/python/ai/chronon/query.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def Query(
2626
setups: List[str] = None,
2727
mutation_time_column: str = None,
2828
reversal_column: str = None,
29+
partition_column: str = None,
2930
) -> api.Query:
3031
"""
3132
Create a query object that is used to scan data from various data sources.
@@ -63,13 +64,16 @@ def Query(
6364
represents mutation time. Time should be milliseconds since epoch.
6465
This is not necessary for event sources, defaults to "mutation_ts"
6566
:type mutation_time_column: str, optional
66-
:param reversal_column: str, optional
67+
:param reversal_column: (defaults to "is_before")
6768
For entities with realtime accuracy, we divide updates into two additions & reversal.
6869
updates have two rows - one with is_before = True (the old value) & is_before = False (the new value)
6970
inserts only have is_before = false (just the new value).
7071
deletes only have is_before = true (just the old value).
7172
This is not necessary for event sources.
72-
:param reversal_column: str, optional (defaults to "is_before")
73+
:type reversal_column: str, optional
74+
:param partition_column:
75+
Specify this to override spark.chronon.partition.column set in teams.py for this particular query.
76+
:type partition_column: str, optional
7377
:return: A Query object that Chronon can use to scan just the necessary data efficiently.
7478
"""
7579
return api.Query(
@@ -81,6 +85,7 @@ def Query(
8185
setups,
8286
mutation_time_column,
8387
reversal_column,
88+
partition_column,
8489
)
8590

8691

0 commit comments

Comments
 (0)