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

lazy load agate #954

Closed
wants to merge 2 commits into from
Closed

lazy load agate #954

wants to merge 2 commits into from

Conversation

dwreeves
Copy link
Contributor

resolves #953

Problem

TLDR: lazy-loading agate speeds up the load time of dbt by about 3.5%. Most instances of agate are unnecessary as dbt only uses it in a select few situations, and most instances of agate can be placed behind TYPE_CHECKING.

Already implemented in dbt-adapters and dbt-core.

Check performed (should return empty list):

import sys
import dbt.adapters.snowflake.impl
print([i for i in sys.modules if "agate" in i])

Solution

from typing import TYPE_CHECKING

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX

@dwreeves dwreeves requested a review from a team as a code owner May 14, 2024 01:18
@VersusFacit VersusFacit added ok to test test all ready_for_review Externally contributed PR has functional approval, ready for code review from Core engineering test python3.9 labels May 14, 2024
@VersusFacit
Copy link
Contributor

Wondering if that check you give can be written as a simple unit test across the three? I'd imagine you could and it would be trivial to reproduce for all of them :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes ok to test ready_for_review Externally contributed PR has functional approval, ready for code review from Core engineering test all test python3.9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Lazy load agate
3 participants