Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Delay start of engine #46

Merged
merged 4 commits into from
Feb 10, 2023
Merged

Delay start of engine #46

merged 4 commits into from
Feb 10, 2023

Conversation

ahuang11
Copy link
Contributor

@ahuang11 ahuang11 commented Feb 9, 2023

Delay start of engine until needed like PrefectHQ/prefect-snowflake#58

Useful in cases where user simply wants to save block or use in prefect-dbt

Example

Screenshots

Checklist

  • References any related issue by including "Closes #" or "Closes ".
    • If no issue exists and your change is not a small fix, please create an issue first.
  • Includes tests or only affects documentation.
  • Passes pre-commit checks.
    • Run pre-commit install && pre-commit run --all locally for formatting and linting.
  • Includes screenshots of documentation updates.
    • Run mkdocs serve view documentation locally.
  • Summarizes PR's changes in CHANGELOG.md

Comment on lines -937 to -940
self._start_engine() # block initialization doesn't get called here
self._start_exit_stack()
self._unique_results = {}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These will be set to None:

        data.update({k: None for k in {"_engine", "_exit_stack", "_unique_results"}})

And when get_engine / get_connection is called, it'll be back to normal.

@ahuang11 ahuang11 requested a review from a team February 9, 2023 01:01
@ahuang11 ahuang11 merged commit 4d7fcbb into main Feb 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants