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

Cloud Caching #885

Merged
merged 11 commits into from
Apr 3, 2019
Merged

Cloud Caching #885

merged 11 commits into from
Apr 3, 2019

Conversation

cicdw
Copy link
Member

@cicdw cicdw commented Apr 3, 2019

Thanks for contributing to Prefect!

Please describe your work and make sure your PR:

  • adds new tests (if appropriate)
  • updates CHANGELOG.md (if appropriate)
  • updates docstrings for any new functions or function arguments, including docs/outline.toml for API reference docs (if appropriate)

What does this PR change?

This PR implements a new client method for extracting stored cached states, and additionally implements the necessary queries so that cached tasks will work across flow runs in Cloud.

cd prefect
yarn install
pip install "prefect[all_extras]"
pip install ".[all_extras]"
Copy link
Member Author

Choose a reason for hiding this comment

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

I updated this because otherwise it would break if new classes / methods were added in the master branch vs. the latest release

joshmeek
joshmeek previously approved these changes Apr 3, 2019
"where": {
"state": {"_eq": "Cached"},
"task_id": {"_eq": task_id},
"created": {"_gte": created_after.isoformat()},
Copy link
Member

@jlowin jlowin Apr 3, 2019

Choose a reason for hiding this comment

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

Sorry I didn't catch this last night -- this field "created" is when the task_run itself was created. You'll want to check the state_timestamp field instead, which is the time the current state was set for the task_run.

As an example, a task run might be created today in anticipation of a scheduled flow run, but that run might not start for a month. In a month's time, the task might enter a cached state, and that time (in a month) is the quantity of interest.

Copy link
Member Author

Choose a reason for hiding this comment

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

That makes too much sense -- good catch and sorry for the oversight!

"task_id": {"_eq": task_id},
"created": {"_gte": created_after.isoformat()},
},
"order_by": {"created": EnumValue("desc")},
Copy link
Member

Choose a reason for hiding this comment

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

Same comment regarding created vs state_timestamp

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated

@jlowin
Copy link
Member

jlowin commented Apr 3, 2019

🚀

@cicdw cicdw merged commit 44ab516 into master Apr 3, 2019
@cicdw cicdw deleted the cloud-cache branch April 3, 2019 15:24
abrookins pushed a commit that referenced this pull request Feb 8, 2022
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.

None yet

3 participants