-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Make MAXIMUM_SEED_SIZE_MIB configurable #7125
base: main
Are you sure you want to change the base?
Changes from 5 commits
880b035
19ff160
bfcabbf
866191a
a1afca5
fa836bb
53021d9
3b9b8cf
c2e2958
eb1ba52
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Features | ||
body: Make MAXIMUM_SEED_SIZE configurable | ||
time: 2023-03-07T13:48:38.792321024Z | ||
custom: | ||
Author: noppaz acurtis-evi | ||
Issue: 7117 7124 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
import os | ||
|
||
SECRET_ENV_PREFIX = "DBT_ENV_SECRET_" | ||
DEFAULT_ENV_PLACEHOLDER = "DBT_DEFAULT_PLACEHOLDER" | ||
METADATA_ENV_PREFIX = "DBT_ENV_CUSTOM_ENV_" | ||
|
||
MAXIMUM_SEED_SIZE = 1 * 1024 * 1024 | ||
MAXIMUM_SEED_SIZE_NAME = "1MB" | ||
|
||
def get_max_seed_size(): | ||
mx = os.getenv("DBT_MAXIMUM_SEED_SIZE", "1") | ||
return int(mx) | ||
|
||
|
||
DEFAULT_MAXIMUM_SEED_SIZE = 1 * 1024 * 1024 | ||
MAXIMUM_SEED_SIZE = get_max_seed_size() * DEFAULT_MAXIMUM_SEED_SIZE | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need both of these constants defined. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for checking @jtcohen6! One reason for keeping The reason for not converting from bytes to UTF-8 string is performance and somewhat cleaner code but if we want to remove
What's your thoughts on this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've implemented this suggestion with removal of |
||
MAXIMUM_SEED_SIZE_NAME = str(get_max_seed_size()) + "MiB" | ||
|
||
PIN_PACKAGE_URL = ( | ||
"https://docs.getdbt.com/docs/package-management#section-specifying-package-versions" | ||
|
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'd prefer that this config's name include the unit:
DBT_MAXIMUM_SEED_SIZE_MIB
Rather than accessing an env var directly here, this should really be implemented as a "global config" (available in our
Flags
module). I don't think it would make very much sense to pass as a CLI flag (--maximum-seed-size
), but I could very much see someone wanting to set this in "user config":That means:
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 have addressed this in fa836bb. It required some additional moving of the usage of the global flag as it is not a constant anymore and the constants.py file is referenced much earlier in the import cycle.