-
Notifications
You must be signed in to change notification settings - Fork 65
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
Semantic model perf lab #426
base: main
Are you sure you want to change the base?
Conversation
return str(self._properties) | ||
|
||
|
||
def _get_or_create_workspace( |
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.
should move to common utils.
create_abfss_path, | ||
) | ||
|
||
class PropertyBag: |
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.
why not just dict?
raise ValueError("For new workspaces, the workspace parameter must be string, not a Guid. Please provide a workspace name.") | ||
except ValueError: | ||
# OK, it's not a Guid. But also make sure the workspace parameter isn't empty. | ||
if workspace == "" or workspace is None: |
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.
just use if workspace:
https://stackoverflow.com/questions/9573244/how-to-check-if-the-string-is-empty-in-python
print(f"{icons.green_dot} Workspace '{workspace_name}' created.") | ||
return (workspace,workspace_id) | ||
|
||
def _get_or_create_lakehouse( |
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.
move to utility file
""" | ||
|
||
# Treat empty strings as None. | ||
if lakehouse == "": |
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.
not sure why this is needed.
|
||
try: | ||
(target_workspace_name, target_workspace_id) = resolve_workspace_name_and_id(workspace=target_workspace) | ||
except: |
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.
catch specific exception, otherwise we mask errors
|
||
return spark.createDataFrame(rows, schema=schema).dropDuplicates() | ||
|
||
def _get_min_max_keys( |
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.
move to util file
def get_storage_table_column_segments( | ||
test_cycle_definitions: DataFrame, | ||
tables_info: DataFrame | ||
)->DataFrame: |
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.
run black to get formatting
|
||
try: | ||
(target_workspace_name, target_workspace_id) = resolve_workspace_name_and_id(workspace=target_workspace) | ||
except: |
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.
catch specific exception
] | ||
|
||
|
||
def _get_test_definitions( |
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.
the dataframe seems small, so I'd suggest not to use a pandas dataframe.
since you want to subsequently persist it (and maybe re-hydrate), I think a separate class would make it more convenient.
Functions to provision and run a Semantic Model Perf Lab for continuous testing and ad-hoc investigations.