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

feat/Add new cli to generate schema as yaml #6

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rbiseck3
Copy link
Collaborator

Description

Initial introduction of new etl-schema that takes the same pointers to a python function as etl-uvicorn and prints the generated schema as yaml to populate in a manifest for a given plugin. This can be updated to support writing output to a yaml file.

Example:

pip install .
PYTHONPATH=. etl-schema test.assets.typed_dict_response:sample_function
inputs:
  properties:
    content:
      properties:
        name:
          type: string
        value:
          type: number
      required:
      - name
      - value
      type: object
  required:
  - content
  type: object
outputs:
  properties:
    response:
      type: object
  required:
  - response
  type: object

@rbiseck3 rbiseck3 changed the title feat/Add new cli to print schema as yaml feat/Add new cli to generate schema as yaml Jun 26, 2024
Comment on lines +10 to +11
output = generate_yaml(app="test.assets.typed_dict_response:sample_function")
file_path = results_path / "simple.yaml"
Copy link

@hubert-rutkowski85 hubert-rutkowski85 Jul 2, 2024

Choose a reason for hiding this comment

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

Nitpick: there is no obvious relation between sample_function stored in test.assets.typed_dict_response.py, and expected_results/simple.yaml . Naming it like expected_results/typed_dict_response:sample_function.yaml would make it painfully clear, unfortunately it's a mouthful. Maybe it's ok, or maybe just using the filename, or a function name, would be good enough. I'll leave it for you to decide, to not keep this PR waiting any longer.

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