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

#85 Implement passing of format-specific options to pramen-py MetaSto… #118

Merged
merged 1 commit into from
Jan 12, 2023

Conversation

jirifilip
Copy link
Collaborator

@jirifilip jirifilip commented Jan 9, 2023

Implemented passing of format-specific options from Pramen (HOCON config) to Pramen-Py (YAML config).

HOCON config example:

pramen.metastore {
  tables = [
    {
        name = "table"
        format = "parquet"
        path = "/some/path"
        read.option {
          compression = "gzip"
          mergeSchema = "true"
        }
        write.option {
          compression = "gzip"
        }
    },
  ]
}

Generated YAML which is then passed to Pramen-Py:

metastore_tables:
- name: table
  format: parquet
  path: /some/path
  records_per_partition: 500000
  info_date_settings:
    column: pramen_info_date
    format: yyyy-MM-dd
    start: 2020-01-01
  reader_options:
    compression: "gzip"
  writer_options:
    compression: gzip

Somes ideas for discussion

  • on Scala side, I modified MetastoreSpy to allow specifying readOptions and writeOptions but those options are then applied to every mocked metastore table. I did this for simplicity reasons but is that ok/clean?
  • on Python side, I kind of wrote "dumb" tests 😃 (one function per test, not any parametrization). I was toying with @pytest.mark.parametrize but the variation of my test cases was too big and I thought the intention of what is tested was lost. But happy to revise and rework it to a different form or to use the parametrization since I understand the tests maybe don't exactly match the repo's style.

@jirifilip jirifilip force-pushed the feature/85-metastore-extra-options-through-yaml branch from e8586f3 to 61e0f77 Compare January 9, 2023 12:32
@jirifilip jirifilip marked this pull request as ready for review January 9, 2023 12:43
yruslan
yruslan previously approved these changes Jan 9, 2023
Copy link
Collaborator

@yruslan yruslan left a comment

Choose a reason for hiding this comment

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

Looks great! Just one tiny point to consider

@jirifilip jirifilip marked this pull request as draft January 10, 2023 05:16
@jirifilip jirifilip force-pushed the feature/85-metastore-extra-options-through-yaml branch 2 times, most recently from 23ba627 to d287a62 Compare January 12, 2023 09:21
@jirifilip jirifilip force-pushed the feature/85-metastore-extra-options-through-yaml branch from d287a62 to 6de0404 Compare January 12, 2023 10:05
@jirifilip jirifilip marked this pull request as ready for review January 12, 2023 10:05
@jirifilip jirifilip merged commit f2f40fd into main Jan 12, 2023
@jirifilip jirifilip deleted the feature/85-metastore-extra-options-through-yaml branch January 12, 2023 10:20
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