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

Allow external setter alternatives to transform.yaml #137

Open
hrshdhgd opened this issue Jul 8, 2024 · 2 comments
Open

Allow external setter alternatives to transform.yaml #137

hrshdhgd opened this issue Jul 8, 2024 · 2 comments

Comments

@hrshdhgd
Copy link
Member

hrshdhgd commented Jul 8, 2024

As of now, Koza assumes that an ingest project has transform.yaml located in the same directory as the code that is generating the koza_app object. I seems like attributes of this object cannot be set via code.

Example: Setting the output_dir or delimiter attribute like this:

koza_app = get_koza_app("some-ingest")
koza_app.source.config.delimiter = ","
koza_app.source.config.output_dir = "new_output" # (or koza_app.output_dir) 

OR

koza_app = get_koza_app("some-ingest", **kwargs)

cc: @caufieldjh , @justaddcoffee

@kevinschaper
Copy link
Member

Koza's architecture has a baked in separation of concerns that lets the transform.py really only transform individual rows and pass them to the writer, but everything about the configuration has already happened by the time transform.py runs. The yaml is where the process starts, not the python code.

As the issue is, all that I can say is, "correct, you can't set those things in the transform.py, it's too late" but I bet that we can figure out a solution to the actual problem that fits into Koza's architecture, or handle it before or after Koza using other tooling.

@justaddcoffee
Copy link
Member

Okay, thanks @kevinschaper that makes sense

I guess separating the concern of config parsing also has the advantage that all the config stuff lives in one place (the config file), which makes it easier to see how the transform was done

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

No branches or pull requests

3 participants