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

Support environment variable inheritance from command-line #1086

Open
eromoe opened this issue Mar 27, 2023 · 3 comments
Open

Support environment variable inheritance from command-line #1086

eromoe opened this issue Mar 27, 2023 · 3 comments

Comments

@eromoe
Copy link

eromoe commented Mar 27, 2023

My env like:

basefreq: 1m
train_start_date: "2020-08-11"
train_end_date: "2023-02-19"
test_start_date: "2023-02-19"
test_end_date: "2023-03-21"
autgoluon_model_dir: "{{root}}/AutogluonModels"
train_datemark : "#{{train_start_date}}~{{train_end_date}}"
train_test_datemark: "#{{train_start_date}}~{{train_end_date}}_{{test_start_date}}~{{test_end_date}}"

I was doing a walk forwarding train test

for a,b,c,d in split_dates('20200701', '20230319', 100, 30, 200):
    cmd = 'ploomber build --env--train_start_date %s --env--train_end_date %s --env--test_start_date %s --env--test_end_date %s' % (to_datestr(a), to_datestr(b), to_datestr(c), to_datestr(d))
    print(cmd)
    os.system(cmd)

Then I found train_datemark and train_test_datemark remain old env values.

@edublancas
Copy link
Contributor

can you provide a reproducible example? I'm not following what you're expecting and what ploomber is doing

@edublancas
Copy link
Contributor

ah. I think I now understand what you mean (based on this)

yeah, this looks like a bug, do you have time to submit a PR?

@eromoe
Copy link
Author

eromoe commented Mar 28, 2023

Looks like target file is https://github.com/ploomber/ploomber/blob/8a9fccd14938d805941046d2d65d6cd6a8d9468e/src/ploomber/env/expand.py , I would take a look when have time

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

2 participants