-
Notifications
You must be signed in to change notification settings - Fork 15
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
Lift + shift for cross-db macros #25
Conversation
Functional tests are running, which is actually amazing. The other tests are running into a |
10a0140
to
8f01640
Compare
The idea would be:
|
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.
You are amazing.
Love the creation of the macros/dbt_utils/cross_db_utils/deprecated
folder. Separates things nicely.
pytest | ||
pyodbc==4.0.32 | ||
git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-core&subdirectory=core | ||
git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-tests-adapter&subdirectory=tests/adapter | ||
git+https://github.com/dbt-labs/dbt-spark.git#egg=dbt-spark[ODBC] |
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.
This is helpful!
[pytest] | ||
filterwarnings = | ||
ignore:.*'soft_unicode' has been renamed to 'soft_str'*:DeprecationWarning | ||
ignore:unclosed file .*:ResourceWarning | ||
env_files = | ||
test.env | ||
testpaths = | ||
tests/functional |
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.
Last Week I Learned (LWIL):
- By default
pytest-dotenv
will not override any variables already defined in the process' environment
Example
Let's say I have an environment variable defined locally:
DBT_DATABASE_HOST=localhost
And test.env
contains:
DBT_DATABASE_HOST=somethingelse
By default, pytest-dotenv will keep the former and ignore the latter. Scroll down to see how to configure the opposite behavior.
Override default behavior
So it depending on how we want pytest + pytest-dotenv to behave, we either will want to include the following (or not!):
env_override_existing_values = 1
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.
A great LWIL!
This makes sense to me, insofar as I might have a test.env
, but then also want to do:
export DBT_DATABASE_HOST=localhost
python3 -m pytest ...
I would indeed expect the env var I've just supplied to override the one in test.env
Follow-up to: