-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[FEATURE] Experimental Splitter connection testing #7051
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] Experimental Splitter connection testing #7051
Conversation
✅ Deploy Preview for niobium-lead-7998 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
👇 Click on the image for a new way to code review
Legend |
…:great-expectations/great_expectations into f/GREAT-1490/splitter-connection-testing
…:great-expectations/great_expectations into f/GREAT-1490/splitter-connection-testing
) | ||
|
||
|
||
class _SplitterMixin: | ||
class SqliteTableAsset(TableAsset): |
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.
Hopefully I'm not missing anything regarding the benefits of these mixins, but it doesn't seem as scalable as we will likely continue to require dialect-specific SQLAsset
s.
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.
Also, moving to inheritance gets rid of the isinstance
checks and type: ignore
s.
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.
It was about removing verbosity but this looks better to me.
…:great-expectations/great_expectations into f/GREAT-1490/splitter-connection-testing
@@ -278,7 +303,9 @@ def get_batch_list_from_batch_request( | |||
) | |||
# Creating the batch_spec is our hook into the execution engine. | |||
batch_spec = SqlAlchemyDatasourceBatchSpec(**batch_spec_kwargs) | |||
execution_engine: ExecutionEngine = self.datasource.get_execution_engine() | |||
execution_engine: SqlAlchemyExecutionEngine = ( |
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.
❤️ for type narrowing here as well as in the file-path (Pandas, Spark) cases!
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.
@NathanFarmer I am approving, but please do not merge until someone else with more experience in the ZEP world provides feedback as well. I left a note for consideration. For a slightly longer term (within a couple of days), I am also working on a hypothesis for leveraging Data Connectors within the new Asset in the file path modules (Pandas, Spark), which, if works, might entail some beneficial refactoring opportunities in the SQL ZEP modules as well. Thanks!
Everything looks good. The only thing I might consider |
…:great-expectations/great_expectations into f/GREAT-1490/splitter-connection-testing
…:great-expectations/great_expectations into f/GREAT-1490/splitter-connection-testing
@@ -335,22 +338,22 @@ class Datasource( | |||
} | |||
# Setting this in a Datasource subclass will override the execution engine type. | |||
# The primary use case is to inject an execution engine for testing. | |||
execution_engine_override: ClassVar[Optional[Type[ExecutionEngine]]] = None | |||
execution_engine_override: ClassVar[Optional[Type[_ExecutionEngineT]]] = None # type: ignore[misc] |
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 are the details behind this new type ignore? That is, I am curious what the error message is if you don't have this.
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.
Message: ClassVar cannot contain type variables
. I added a comment in this PR: #7010
) | ||
|
||
|
||
class _SplitterMixin: | ||
class SqliteTableAsset(TableAsset): |
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.
It was about removing verbosity but this looks better to me.
… of https://github.com/great-expectations/great_expectations into f/dx-244/dx-247/sql-column-pair-and-multi-column-id-pk * 'f/dx-244/dx-247/sql-column-pair-and-multi-column-id-pk' of https://github.com/great-expectations/great_expectations: [FEATURE] ID/PK `ColumnPairExpectations` and `MultiColumnMapExpectations` - Spark (#7001) [FEATURE] Experimental Splitter connection testing (#7051) [DOCS] Add new `DataContext` CRUD to public API (#7058) [FEATURE] ZEP - generate pandas assets (#7044) [MAINTENANCE] fix - `FutureWarning: pandas.Float64Index is deprecated` when importing `great_expectations` (#7055) [MAINTENANCE] finish linting `great_expectations` (#7050) [MAINTENANCE] ruff `0.0.241` (#7048) [MAINTENANCE] Standardize `Checkpoint` CRUD (#6962) [MAINTENANCE] replace `isort` with `ruff` sorting rules (#6907) [MAINTENANCE] Minor Cleanup (#7047) [FEATURE] Experimental `DataAsset` `test_connection` (#7019) [FEATURE] Add SQL query data asset for new experimental datasources (#6999)
Changes proposed in this pull request:
connection_test
forColumnSplitter
Generic
TypeVar
ColumnSplitterType
in anticipation of additional Splitter classes/methods and the need for connection testing forTableAsset
splitters, but notQueryAsset
splittersisinstance
/type ignoresGeneric
TypeVar
ExecutionEngineType
for passing alongDatasource.get_execution_engine()
typing informationDatasource
test_connection
error message unit test less brittleDefinition of Done