Comments (3)
Digging a bit more, I guess this might be actually misunderstanding, as seems like I was using --env
incorrectly:
If the env var is just applied as a normal env var, things work:
$ DEBUG=true bonobo run debugtest.py
DEBG:0000:stevedore.extension: found extension EntryPoint.parse('convert = bonobo.commands.convert:ConvertCommand')
DEBG:0000:stevedore.extension: found extension EntryPoint.parse('download = bonobo.commands.download:DownloadCommand')
DEBG:0000:stevedore.extension: found extension EntryPoint.parse('examples = bonobo.commands.examples:ExamplesCommand')
DEBG:0000:stevedore.extension: found extension EntryPoint.parse('init = bonobo.commands.init:InitCommand')
DEBG:0000:stevedore.extension: found extension EntryPoint.parse('inspect = bonobo.commands.inspect:InspectCommand')
DEBG:0000:stevedore.extension: found extension EntryPoint.parse('run = bonobo.commands.run:RunCommand')
DEBG:0000:stevedore.extension: found extension EntryPoint.parse('version = bonobo.commands.version:VersionCommand')
DEBG:0000:root: Command: run Arguments: {'command': 'run', 'file': 'debugtest.py', 'mod': None, 'default_env_file': None, 'default_env': None, 'env_file': None, 'env': None, 'quiet': False, 'verbose': False, 'install': False}
<Setting DEBUG=True>
<Setting PROFILE=False>
DEBG:0000:root: Creating execution strategy 'threadpool'...
DEBG:0000:bonobo.execution.contexts.node: Node loop starts for <NodeExecutionContext(+extract)>.
DEBG:0000:bonobo.execution.contexts.node: Node loop ends for <NodeExecutionContext(-extract) in=1 out=1>.
- extract(0) in=1 out=1 [done]
(not exactly the same --debug
, actually it gives more logs)
The confusion was:
- for
DEBUG
, eitherDEBUG=True bonobo run ....
orbonobo --debug run ...
has to be used,--env DEBUG=True
doesn't take effect - for other variables,
ENV=something bonobo ...
orbonobo run --env ...
(or other environment settings that are available) can be used, but--env
shouldn't really be used for this, but env vars for the actual graph....
This might warrant some documentation clarifications, but does not feel like a bug anymore, sorry for the noise!
from bonobo.
The issue you faced is because arguments are parsed by bonobo.parse_args(parser)
.
You should be able to see the values you wanted to see if you do print(bonobo.settings.DEBUG)
within the with
block. If this does not work, then it's a bug.
from bonobo.
Retried again, moving the test inside the with
block:
# debugtest.py
import bonobo
def extract():
yield "test"
if __name__ == "__main__":
parser = bonobo.get_argument_parser()
with bonobo.parse_args(parser) as options:
print(bonobo.settings.DEBUG)
bonobo.run(bonobo.Graph(extract), services={})
resulting in these outcomes of the 4 different cases of applying env vars, that I understood:
DEBUG=true bonobo run debugtest.py
, DEBUG env var is set ✅bonobo --debug run debugtest.py
, DEBUG env var is set ✅bonobo run debugtest.py --env DEBUG=true
, DEBUG env var is not set (stays default false) ❌bonobo run debugtest.py --env-file env
(withenv
containingDEBUG=true
) DEBUG env var is not set (stays default false) ❌
from bonobo.
Related Issues (20)
- Documentation missing - Not clear how to check if there were any errors in transformation nodes HOT 1
- Allow packaging==20.3 HOT 6
- resolve start and end of named chain are identical as _input and _output HOT 4
- Filter Node error HOT 2
- in the absence of docs - need some real world, readable examples HOT 1
- How to configure logging in bonobo to always log to stdout
- incompatibility with pip==20.x
- bonobo_sqlalchemy.Select remove easy limit for oracle HOT 1
- Graceful termination hangs when filtering data
- AttributeError: Graph and get_cursor() HOT 1
- Documentation example broken HOT 3
- CsvReader does not accept files in another directory HOT 2
- CsvReader does not accept absolute path names in Windows HOT 7
- No output in docker container
- [FR] loop (sub-)chains HOT 1
- Example for using the RateLimited feature?
- processors.py need to be updated for Python 3.10+ for collections HOT 7
- Bug: Could not load 'init': cannot import name 'soft_unicode' from 'markupsafe' HOT 2
- Is the project being abondoned? HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bonobo.