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

Add validate_df task to OutlookToADLS flow #788

Merged
merged 6 commits into from
Oct 26, 2023

Conversation

jkrobicki
Copy link
Contributor

Summary

  • Added validate_df_dict parameter to OutlookToADLS flow
  • Added tests for the flow run and new parameter in the OutlookToADLS flow

Importance

New functionality to check the data

Checklist

This PR:

  • follows the guidelines laid out in CONTRIBUTING.md
  • links relevant issue(s)
  • adds/updates tests (if appropriate)
  • adds/updates docstrings (if appropriate)
  • adds an entry in CHANGELOG.md

@jkrobicki jkrobicki requested a review from gwieloch October 26, 2023 07:36
Copy link
Contributor

@gwieloch gwieloch left a comment

Choose a reason for hiding this comment

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

pls change new parameter to validate_df_dict

@@ -29,6 +30,7 @@ def __init__(
limit: int = 10000,
timeout: int = 3600,
if_exists: Literal["append", "replace", "skip"] = "append",
validation_df_dict: dict = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

validate_df_dict: dict = None,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -54,6 +56,8 @@ def __init__(
timeout(int, optional): The amount of time (in seconds) to wait while running this task before
a timeout occurs. Defaults to 3600.
if_exists (Literal['append', 'replace', 'skip'], optional): What to do if the local file already exists. Defaults to "append".
validation_df_dict (dict, optional): An optional dictionary to verify the received dataframe.
Copy link
Contributor

Choose a reason for hiding this comment

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

validate_df_dict

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -65,6 +69,9 @@ def __init__(
self.local_file_path = local_file_path
self.if_exsists = if_exists

# Validate DataFrame
self.validation_df_dict = validation_df_dict
Copy link
Contributor

Choose a reason for hiding this comment

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

up

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -98,6 +105,11 @@ def gen_flow(self) -> Flow:
dfs = apply_map(self.gen_outlook_df, self.mailbox_list, flow=self)

df = union_dfs_task.bind(dfs, flow=self)

if self.validation_df_dict:
validation = validate_df(df=df, tests=self.validation_df_dict, flow=self)
Copy link
Contributor

Choose a reason for hiding this comment

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

up

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@m-paz m-paz merged commit 6d857b5 into dyvenia:dev Oct 26, 2023
3 checks passed
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.

3 participants