-
Notifications
You must be signed in to change notification settings - Fork 16
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
[5/n] Adds integration test for disabling snapshots #1404
[5/n] Adds integration test for disabling snapshots #1404
Conversation
…to eng-3000-allow-users-to-opt-out-of-data-snapshots-5
…to eng-3000-allow-users-to-opt-out-of-data-snapshots-5
…to eng-3000-allow-users-to-opt-out-of-data-snapshots-5
if self._execution_status != ExecutionStatus.SUCCEEDED: | ||
if ( | ||
not self._execution_state | ||
or self._execution_state.status != ExecutionStatus.SUCCEEDED |
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.
Um shouldn't this return None if the artifact was deleted? The error message talks about "computed successfully!" which is true when status is Deleted.
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.
That's a good catch! It's interesting that we are not handling other state though. Following the same argument I think we should. I will just address the DELETE state in this PR though
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.
What do you mean by handling other state? None of the other states computed the artifact successfully.
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.
I mean for fetched workflow runs, it's reasonable to call .get()
even if the artifact is with fail / cancel / pending state with less blocking behavior like throwing this error
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.
yeah I think we just wanted to disambiguate a failed artifact vs an operator that returned 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.
I see, in that way I will add a few lines to print warning message if the artifact is deleted
sdk/aqueduct/backend/api_client.py
Outdated
@@ -669,10 +668,10 @@ def get_artifact_result_data( | |||
if "data" in parsed_response: | |||
return_value = deserialize(serialization_type, artifact_type, parsed_response["data"]) | |||
|
|||
if execution_status != ExecutionStatus.SUCCEEDED: | |||
if not execution_state or execution_state.status != ExecutionStatus.SUCCEEDED: |
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.
Same question here about handling of DELETED status. Can we get away with just returning return_value
in that case (if it's 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.
@likawind was this addressed? I'm not sure it's clear to me what happens when you call this on a deleted artifact. It would be great if that was in the function's docstring too
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.
oh oh this line just prints a warning and doesn't affects the execution flow
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.
oh I missed that lol. Can you note that DELETED -> None in the docstring though.
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.
yeah updated the warning message and docstring
@kenxu95 thanks for the feedbacks! updated |
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.
It's good, I just had one blocking comment about get_artifact_result_data()
@@ -128,6 +129,9 @@ def head(self, n: int = 5, parameters: Optional[Dict[str, Any]] = None) -> pd.Da | |||
A dataframe containing the table contents of this artifact. | |||
""" | |||
df = self.get(parameters=parameters) | |||
if df is None: | |||
return 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.
nit: slightly more python for `return df.head(n) if df else 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.
oh actually I do this intentionally as I believe if df
will be False
if df is empty. But we can shrink that to one line though
sdk/aqueduct/backend/api_client.py
Outdated
@@ -669,10 +668,10 @@ def get_artifact_result_data( | |||
if "data" in parsed_response: | |||
return_value = deserialize(serialization_type, artifact_type, parsed_response["data"]) | |||
|
|||
if execution_status != ExecutionStatus.SUCCEEDED: | |||
if not execution_state or execution_state.status != ExecutionStatus.SUCCEEDED: |
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.
@likawind was this addressed? I'm not sure it's clear to me what happens when you call this on a deleted artifact. It would be great if that was in the function's docstring too
sdk/aqueduct/backend/api_client.py
Outdated
@@ -669,10 +668,10 @@ def get_artifact_result_data( | |||
if "data" in parsed_response: | |||
return_value = deserialize(serialization_type, artifact_type, parsed_response["data"]) | |||
|
|||
if execution_status != ExecutionStatus.SUCCEEDED: | |||
if not execution_state or execution_state.status != ExecutionStatus.SUCCEEDED: |
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.
oh I missed that lol. Can you note that DELETED -> None in the docstring though.
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.
LGTM!
Describe your changes and why you are making these changes
This PR adds integration tests for disabling snapshots. To properly examine the exec states of flows, we also added exec state tracking for all artifact types.
Also included a fix for
ENG-3103
to fix datetime parsingRelated issue number (if any)
ENG-3000 ENG-3103
Tests
pip install .
andinstall_local
script, without install from a pypi package).Checklist before requesting a review
python3 scripts/run_linters.py -h
for usage).run_integration_test
: Runs integration testsskip_integration_test
: Skips integration tests (Should be used when changes are ONLY documentation/UI)