-
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
[MAINTENANCE] Enforce mandatory docstrings for public API decorated objects #10799
base: develop
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for niobium-lead-7998 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
❌ 4 Tests Failed:
View the top 3 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
…m/great-expectations/great_expectations into m/_/enforce_public_api_docstrings
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'm not approving since I'm reviewing only the copy (and not the new test)
But, none of my copy feedback is severe enough to be a blocker on its own, so I'm also not requesting changes.
The vast majority of my comments are capitalization changes to abide the style guide though there are some more substantive notes. I was short on time before vacation so I didn't go as deep in this review as I would have liked. But I'll be iterating this content as part of the API reference improvements so I think that's ok.
@@ -295,6 +295,24 @@ def run( | |||
expectation_parameters: SuiteParameterDict | None = None, | |||
run_id: RunIdentifier | None = None, | |||
) -> CheckpointResult: | |||
""" | |||
Runs the Checkpoint's underlying validation definitions and actions. |
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.
Runs the Checkpoint's underlying validation definitions and actions. | |
Runs the Checkpoint's underlying Validation Definitions and Actions. |
batch_parameters: Parameters to be used when loading the batch. | ||
expectation_parameters: Parameters to be used when validating the batch. |
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.
batch_parameters: Parameters to be used when loading the batch. | |
expectation_parameters: Parameters to be used when validating the batch. | |
batch_parameters: Parameters to be used when loading the Batch. | |
expectation_parameters: Parameters to be used when validating the Batch. |
CheckpointRunWithoutValidationDefinitionError: If the Checkpoint is run without any | ||
validation definitions. | ||
CheckpointNotAddedError: If the Checkpoint has not been added to the store. | ||
CheckpointNotFreshError: If the Checkpoint has been modified since it was last added | ||
to the store. |
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.
CheckpointRunWithoutValidationDefinitionError: If the Checkpoint is run without any | |
validation definitions. | |
CheckpointNotAddedError: If the Checkpoint has not been added to the store. | |
CheckpointNotFreshError: If the Checkpoint has been modified since it was last added | |
to the store. | |
CheckpointRunWithoutValidationDefinitionError: If the Checkpoint is run without any | |
Validation Definitions. | |
CheckpointNotAddedError: If the Checkpoint has not been added to the Store. | |
CheckpointNotFreshError: If the Checkpoint has been modified since it was last added | |
to the Store. |
batch_parameters: Parameters to be used when loading the batch. | ||
expectation_parameters: Parameters to be used when validating the batch. |
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.
Would it be accurate/helpful to reuse the more robust batch_parameters
and expectation_parameters
definitions from the ValidationDefinition page here?
batch_parameters –
The dictionary of parameters necessary for selecting the correct batch to run the validation on. The keys are strings that are determined by the BatchDefinition used to instantiate this ValidationDefinition. For example:
- whole table -> None
- yearly -> year
- monthly -> year, month
- daily -> year, month, day
expectation_parameters – A dictionary of parameters values for any expectations using parameterized values (the $PARAMETER syntax). The keys are the parameter names and the values are the values to be used for this validation run.
Returns: | ||
A CheckpointResult object containing the results of the run. | ||
|
||
Raises: |
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 noticed that we have a few different patterns in "Raises" sections throughout the API reference
Examples:
https://docs.greatexpectations.io/docs/reference/api/core/ExpectationValidationResult_class - starts with "Raised if ..."
InvalidCacheValueError – Raised if the result does not pass validation.
https://docs.greatexpectations.io/docs/reference/api/ExpectationSuite_class - does not have a conditional lead-in
KeyError – Expectation not found in suite.
https://docs.greatexpectations.io/docs/reference/api/core/factory/CheckpointFactory_class - does not separate error name and definition with a dash
DataContextError if Checkpoint doesn't exist –
It would be great if these were consistently phrased but I think that's outside the scope of this PR. I'll start tracking this as something for me to address as part of the content-focused API docs improvements. I'd love to take a sweep through for consistent phrasing and then put together a style guide for engineering to help with consistency going forward. (If an API docs string style guide already exists and I'm just overlooking it, please point me to it!)
name: The name of the batch definition to be added | ||
column: The column name on which to partition the asset by day | ||
sort_ascending: Boolean to indicate whether to sort ascending (default) or descending. | ||
When running a validation, we default to running the last batch definition |
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.
When running a validation, we default to running the last batch definition | |
When running a validation, we default to running the last Batch Definition |
"""An asset made from a SQL query | ||
|
||
Args: | ||
query: The query to be used to contruct the underlying data asset |
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.
query: The query to be used to contruct the underlying data asset | |
query: The query to be used to construct the underlying Data Asset |
@@ -170,6 +170,17 @@ def add_table_asset( | |||
schema_name: Optional[str] = None, | |||
batch_metadata: Optional[BatchMetadata] = None, | |||
) -> SqliteTableAsset: | |||
"""Adds a table asset to this SQLite datasource |
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 expected this to show up on https://deploy-preview-10799.docs.greatexpectations.io/docs/reference/api/datasource/fluent/SqliteDatasource_class but am not seeing it there. instead I see
Adds a table asset to this datasource.
Is it possible that this SQLite-specific text is being overridden by a generic description?
) -> SqliteQueryAsset: | ||
"""Adds a table asset to this SQLite datasource |
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.
similar to another comment, I'm not seeing this where I expect. But, regardless I wonder if there's a mismatch here since line 203 is about query assets but then line 204 is about table assets
@@ -1270,7 +1270,6 @@ def _get_result_format( | |||
result_format = configuration_result_format | |||
return result_format | |||
|
|||
@public_api |
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.
What's the reason for removing this? I ask because I see validate_configuration
still mentioned elsewhere on the page
Expectation classes ... may provide implementations of:
validate_configuration
, which should raise an error if the configuration will not be usable for the Expectation
Refer to ADR 0005 - we should always have docstrings when dealing with public objects that are rendered in our docs
invoke lint
(usesruff format
+ruff check
)For more information about contributing, visit our community resources.
After you submit your PR, keep the page open and monitor the statuses of the various checks made by our continuous integration process at the bottom of the page. Please fix any issues that come up and reach out on Slack if you need help. Thanks for contributing!