-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat(ingest): bigquery/snowflake - Store last profile date in state #6832
Changes from 7 commits
7b348ac
11ce2e5
f4f9960
36124fb
52a3e09
6584cfb
5107866
286acfa
1cbedf1
0adcd91
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -54,11 +54,21 @@ class SnowflakeV2Config(SnowflakeConfig, SnowflakeUsageConfig): | |||||
description="Whether to populate Snowsight url for Snowflake Objects", | ||||||
) | ||||||
|
||||||
match_fully_qualified_names = bool = Field( | ||||||
enable_profiling_state: bool = Field( | ||||||
default=True, | ||||||
description="Enable storing last profile date in store.", | ||||||
) | ||||||
|
||||||
match_fully_qualified_names: bool = Field( | ||||||
default=False, | ||||||
description="Whether `schema_pattern` is matched against fully qualified schema name `<catalog>.<schema>`.", | ||||||
) | ||||||
|
||||||
enable_usage_lastrun_state: bool = Field( | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does this config feel more clear?
Suggested change
|
||||||
default=True, | ||||||
description="Enable checking last usage date in store.", | ||||||
) | ||||||
|
||||||
@validator("include_column_lineage") | ||||||
def validate_include_column_lineage(cls, v, values): | ||||||
if not values.get("include_table_lineage") and v: | ||||||
|
@@ -140,3 +150,17 @@ def get_sql_alchemy_url( | |||||
return BaseSnowflakeConfig.get_sql_alchemy_url( | ||||||
self, database=database, username=username, password=password, role=role | ||||||
) | ||||||
|
||||||
@root_validator(pre=False) | ||||||
def stateful_option_validator(cls, values: Dict) -> Dict: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. given that these options were basically copy-pasted between the two source configs, it might be worthwhile to add a mixin class for the config |
||||||
# Extra default SQLAlchemy option for better connection pooling and threading. | ||||||
# https://docs.sqlalchemy.org/en/14/core/pooling.html#sqlalchemy.pool.QueuePool.params.max_overflow | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These comments don't seem relevant |
||||||
sti = values.get("statefule_ingestion") | ||||||
if not sti or not sti.get("enabled"): | ||||||
logger.warning( | ||||||
"Stateful ingestion is disabled, disabling related config options as well" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's only print the warning if (1) they actually set the config (not just the default kicking in) and (2) the current value is true and we're changing it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we may need to change it to a pre=True validator to do that, but not 100% sure |
||||||
) | ||||||
values["enable_profiling_state"] = False | ||||||
values["enable_usage_lastrun_state"] = False | ||||||
|
||||||
return values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is effectively "store new state?" right
I feel like the config name isn't super clear, but I'm not sure what would be better