Skip to content
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] Remove fluent partitioner methods from DataAssets #9517

Merged
merged 120 commits into from Feb 28, 2024

Conversation

joshua-stauffer
Copy link
Member

  • Description of PR changes above includes a link to an existing GitHub issue
  • PR title is prefixed with one of: [BUGFIX], [FEATURE], [DOCS], [MAINTENANCE], [CONTRIB]
  • Code is linted - run invoke lint (uses black + ruff)
  • Appropriate tests and docs have been updated

For more information about contributing, see Contribute.

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!

@@ -304,11 +284,13 @@ def add_batch_config(
batch_config = BatchConfig(name=name, partitioner=partitioner)
batch_config.set_data_asset(self)
self.batch_configs.append(batch_config)
self.update_batch_config_field_set()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We now need to always remember to call this after each update to self.batch_configs? Is there a better way to do this without putting the burden on future devs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @tyler-hoffman - this was a bugfix he snuck in, since the context was in this PR

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've added a ticket, and will have a solution as a followup 🙇

@override
def get_batch_request_options_keys(self, partitioner):
def get_batch_request_options_keys(self, partitioner: Optional[Partitioner] = None):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we annotate the return?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was under the impression that we got this typing from the parent class, so adding types here is redundant. But if i'm wrong about that, I'm happy to update!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i gave this some more thought, and i think you're right, even though the type is provided by the parent class, it's easiest to read if its also here. will update, thanks! 👍

Copy link
Contributor

@tyler-hoffman tyler-hoffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had some questions about future improvements, but this looks solid to me.

@@ -1056,23 +890,6 @@ def test_connection(self) -> None:
f"failed. Ensure the table exists and the user has access to select data from the table: {query_error}"
) from query_error

@override
def test_partitioner_connection(self) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to move this to the batch config (but probably not call it automatically)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is only implemented for SQL partitioners, so to me it felt like a half baked feature. It would make more sense to me if we just had a BatchConfig.test_connection() method which checks the configuration, including the partitioner.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, makes sense to me.

@@ -176,36 +174,10 @@ def get_partitioner_implementation(
)
return PartitionerClass(**abstract_partitioner.dict())

@property
@override
def batch_request_options(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a ticket to add this property to BatchConfigs and have them call this method on their asset?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v1-205 👍

@joshua-stauffer joshua-stauffer added this pull request to the merge queue Feb 28, 2024
Merged via the queue into develop with commit c882919 Feb 28, 2024
67 of 68 checks passed
@joshua-stauffer joshua-stauffer deleted the m/v1-175/remove_legacy_partition_methods branch February 28, 2024 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants