Skip to content
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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Semantic model perf lab #426

wants to merge 9 commits into from

Conversation

KayUnkroth
Copy link

Functions to provision and run a Semantic Model Perf Lab for continuous testing and ad-hoc investigations.

return str(self._properties)


def _get_or_create_workspace(
Copy link
Contributor

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:
Copy link
Contributor

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:
Copy link
Contributor

Choose a reason for hiding this comment

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

print(f"{icons.green_dot} Workspace '{workspace_name}' created.")
return (workspace,workspace_id)

def _get_or_create_lakehouse(
Copy link
Contributor

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 == "":
Copy link
Contributor

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:
Copy link
Contributor

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(
Copy link
Contributor

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:
Copy link
Contributor

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:
Copy link
Contributor

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(
Copy link
Contributor

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.

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