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

Move logic from schema accumulator object to combinefn #723

Merged
merged 5 commits into from
Apr 3, 2024

Conversation

moradology
Copy link
Contributor

@moradology moradology commented Apr 2, 2024

The schema accumulator object is basically a tuple. Its methods duplicate the intent of CombineFn's methods and this doesn't seem necessary.

These changes surface the reduce behavior of a combineFn in terms of pure functions. The tests will reflect this as now results from prior combination operations have to be threaded through manually (beam handles this in the normal context)

@@ -108,85 +106,3 @@ def test_schema_to_template_ds_attrs():

assert dst.attrs["pangeo-forge:test_attr_key"] == "test_attr_value"
assert dst.attrs["original_attrs_key"] == "original_attrs_value"


def test_concat_accumulator():
Copy link
Contributor

Choose a reason for hiding this comment

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

Your changes above make sense but I see you are removing tests here. Should we be keeping some of these?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's doable directly via the combinefn. Should be fairly easy...

@moradology moradology force-pushed the feature/simplify-schema-combine branch from 33c4874 to b60f896 Compare April 3, 2024 17:59
@moradology moradology merged commit 729dfb8 into main Apr 3, 2024
6 checks passed
@moradology moradology deleted the feature/simplify-schema-combine branch April 3, 2024 18:09
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.

2 participants