-
Notifications
You must be signed in to change notification settings - Fork 120
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
[Feature] Include files from another directory for jinja2 templates #191
Comments
Hi @skylarbpayne , this feature sounds nice to me, but I'm not sure about the design. I have the following concepts in my mind:
The
Which one seems to you better? I personally prefer option #2, but only because it's way simpler to implement 😄 |
(2) sounds great to me! Though, I imagine you might mean "from current working directory" (which I think would be the root of the project most of the time)? I'll sign the CLA and take a stab at this! |
My PR is out of date now -- but given lack of any response over a month, I'm not sure it's a good use of my time to update. LMK if/when you may have some bandwidth and I'd be happy to update this. Until then, I'll move my team off dbx |
hi @skylarbpayne , I'm really sorry for the late reply - it's pretty hard to keep all things in sync. |
No problem! I imagine it's difficult to keep up with. If there's a communication channel that works better for you, LMK. I'm happy to help out quite a bit, but I just don't want to put the time in if there isn't bandwidth on the other end :) Looks like there were some windows failures on this PR. I'll take a look -- I don't have a windows machine, so hoping this isn't very tricky to debug 😅 |
Okay, I fixed the Windows build -- there's a codecov failure, but I think it's not a meaningful one. Seems caused by me reducing the number of lines of code in the implementation (but the method is still fully covered). LMK if there's something more you think I should do :) |
hi @skylarbpayne , merged in #194 , will be released in 0.6.0. |
This has been removed at some point with refactors. @renardeinside any special reason or would you accept new PRs to re-add this feature to |
Expected Behavior
I expect deployment (or more specifically, rendering) to work with the example below.
Current Behavior
Note: this fails with any incantation for
job_cluster.json
I've found. For example: relative paths from the template directory, absolute paths, etc. All result in the same problem.If I put
job_cluster.json
in the same directory asexample-job.json.j2
then it works. The issue is that the jinja2 environment is setup so that it only knows about the immediate parent directory of the template file; so you can only include other templates from that directory.Making this slightly more flexible would enable much better re-use.
Steps to Reproduce (for bugs)
Two files
jobs/example-job.json.j2
clusters/job_cluster.json
Then run:
dbx deploy --deployment-file jobs/example-job.json.j2
Context
See above.
Your Environment
Not sure what the "best" solution is here, but I believe we could support another argument from the command line to provide additional template load paths when rendering via jinja2.
I'd be happy to take a stab at contributing this.
The text was updated successfully, but these errors were encountered: