-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[FEATURE] Accept a pathlib.Path
context_root_dir
#6613
Conversation
✅ Deploy Preview for niobium-lead-7998 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
pathlib.Path
context_root_dir
pathlib.Path
context_root_dir
👇 Click on the image for a new way to code review
Legend |
3262fc0
to
653010d
Compare
…into f/1402/core-context-zep-config
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.
Thanks for doing this. It seems if we always want Union[str, pathlib.Path]
for these arguments we should make a TypeAlias
to make this a little more concise and so we have a concrete thing to point to if new path arguments get added to the codebase. Could you make this TypeAlias
(maybe in great_expectations/types/
?) and then use that throughout this PR?
@billdirks Good idea will do. |
…into f/1402/core-context-zep-config
@@ -0,0 +1,9 @@ | |||
"""This module contains shared TypeAliases""" |
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.
used alias_types.py
instead of types.py
to avoid weirdness with standard library module names, and to prevent this from being polluted with random types + class definitions.
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.
LGTM, thanks!
…into f/1402/core-context-zep-config
9e6fc05
to
fcfbf9b
Compare
* develop: (31 commits) [BUGFIX] Add sqrt on connect to sqlite database. (#6635) [FEATURE] Docstring linter for public api (#6638) [DOCS] fixing wrong line reference on docs (#6599) [MAINTENANCE] CI - install from `requirements-types.txt` (#6639) [MAINTENANCE] Unexpected Counts table in DataDocs able to show counts for sampled values (#6634) [BUGFIX] Do not round output of proportion computing metrics (#6619) [DOCS] - add anonymous_usage_statistics configutation in documentation (#6626) [FEATURE] Atomic rendering of meta notes (#6627) [MAINTENANCE] Fix develop static type-check stage (#6628) [FEATURE] Accept a `pathlib.Path` `context_root_dir` (#6613) [FEATURE] F/great 1400/sql datasource (#6623) [MAINTENANCE] install `pydantic` in develop pipeline (#6624) [MAINTENANCE] Add `row_condition` logic to `RendererConfiguration` and remove from atomic renderer implementations (#6616) [MAINTENANCE] create cache as part of `--ci` type-checking step (#6621) [FEATURE] Add zep datasource data assistant e2e tests. (#6612) [BUGFIX] Simplify metric results processing and improve detection of Decimal types in columns (#6610) [BUGFIX] Stop overwriting query with static string in RuntimeBatchRequests for SQL (#6614) [MAINTENANCE] update pip installs in pipelines (#6609) [FEATURE] Atomic rendering of Evaluation Parameters (#6232) [MAINTENANCE] partial `cli` + `usage_stats` typing (#6335) ...
Changes proposed in this pull request:
get_context()
and other DataContexts can accept apathlib.Path
objects in addition tostr
paths.This brings
great_expecations
in line with the rest of the Python standard library, which since python3.6
accepts apathlib.Path
orPathlike
object in place of anystr
filepath representation.I went with a minimally invasive approach for this and simply convert any
pathlib.Path
objects tostr
before assigning to an attribute.The better, longer-term approach would be to convert all
str
path representations to apathlib.Path
and pass the richerPath
object around.https://treyhunner.com/2018/12/why-you-should-be-using-pathlib/
https://treyhunner.com/2019/01/no-really-pathlib-is-great/
https://docs.python.org/3/library/pathlib.html#correspondence-to-tools-in-the-os-module
Definition of Done
Please delete options that are not relevant.
addedupdated unit tests where applicable and made sure that new and existing tests are passing.