-
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
fix(ingestion/unity-catalog): fixed issue with profiling with GE turned on #10752
Changes from all commits
a43d5b2
6ea1d29
034dbf6
b5b2f6e
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 | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -262,7 +262,7 @@ def get_workunit_processors(self) -> List[Optional[MetadataWorkUnitProcessor]]: | |||||||||||||||||||||
def get_workunits_internal(self) -> Iterable[MetadataWorkUnit]: | ||||||||||||||||||||||
self.report.report_ingestion_stage_start("Ingestion Setup") | ||||||||||||||||||||||
wait_on_warehouse = None | ||||||||||||||||||||||
if self.config.is_profiling_enabled() or self.config.include_hive_metastore: | ||||||||||||||||||||||
if self.config.include_hive_metastore: | ||||||||||||||||||||||
self.report.report_ingestion_stage_start("Start warehouse") | ||||||||||||||||||||||
# Can take several minutes, so start now and wait later | ||||||||||||||||||||||
wait_on_warehouse = self.unity_catalog_api_proxy.start_warehouse() | ||||||||||||||||||||||
|
@@ -309,9 +309,20 @@ def get_workunits_internal(self) -> Iterable[MetadataWorkUnit]: | |||||||||||||||||||||
) | ||||||||||||||||||||||
|
||||||||||||||||||||||
if self.config.is_profiling_enabled(): | ||||||||||||||||||||||
self.report.report_ingestion_stage_start("Wait on warehouse") | ||||||||||||||||||||||
assert wait_on_warehouse | ||||||||||||||||||||||
wait_on_warehouse.result() | ||||||||||||||||||||||
self.report.report_ingestion_stage_start("Start warehouse") | ||||||||||||||||||||||
# Need to start the warehouse again for profiling, | ||||||||||||||||||||||
# as it may have been stopped after ingestion might take | ||||||||||||||||||||||
# longer time to complete | ||||||||||||||||||||||
wait_on_warehouse = self.unity_catalog_api_proxy.start_warehouse() | ||||||||||||||||||||||
if wait_on_warehouse is None: | ||||||||||||||||||||||
self.report.report_failure( | ||||||||||||||||||||||
"initialization", | ||||||||||||||||||||||
f"SQL warehouse {self.config.profiling.warehouse_id} not found", | ||||||||||||||||||||||
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. So this happens when permission for sql warehouse is missing Or incorrect sql warehouse is specified ? 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. I need to check, as this was the existing codebase 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. this happens when there is no warehouse with specified id. 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. makes sense |
||||||||||||||||||||||
) | ||||||||||||||||||||||
Comment on lines
+317
to
+321
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. Simplify the check for warehouse availability. The check for - if wait_on_warehouse is None:
+ if not wait_on_warehouse: Committable suggestion
Suggested change
|
||||||||||||||||||||||
return | ||||||||||||||||||||||
else: | ||||||||||||||||||||||
# wait until warehouse is started | ||||||||||||||||||||||
wait_on_warehouse.result() | ||||||||||||||||||||||
|
||||||||||||||||||||||
self.report.report_ingestion_stage_start("Profiling") | ||||||||||||||||||||||
if isinstance(self.config.profiling, UnityCatalogAnalyzeProfilerConfig): | ||||||||||||||||||||||
|
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.
Remove redundant variable initialization.
The variable
wait_on_warehouse
is initialized toNone
but is immediately assigned a value if the condition is met.- wait_on_warehouse = None
Committable suggestion