8000 Fix exception when toml lib is not installed by orsinium · Pull Request #2506 · spotify/luigi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix exception when toml lib is not installed #2506

New issue
8000

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

Merged
merged 5 commits into from
Sep 1, 2018

Conversation

orsinium
Copy link
Contributor

Description

Fix issue from comments to #2457 and some related stuff:

  1. Add informative message, when LUIGI_CONFIG_PATH with *.toml file is presented in env vars, but toml lib is not installed yet.
  2. Raise ImportError instead of simple logging, because this is critical issue, that doesn't allow lib works fine.
  3. Add warning when LUIGI_CONFIG_PATH and LUIGI_CONFIG_PARSER point to different parsers.
  4. Add info about toml support in installation section.

Have you tested this? If so, how?

Some minimal tests included and works fine.

@orsinium orsinium changed the title Fix exception without toml installation Fix exception when toml lib is not installed Aug 27, 2018
"Please, install luigi with required parser:\n"
"pip install luigi[{parser}]"
)
raise ImportError(msg.format(parser=parser))
Copy link
Collaborator

Choose a reason for hiding this comment

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

This if not parser_class.enabled is checked at least twice here. Can that be extracted into a method or something for DRY programming purposes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

"Set up right parser via env var: "
"export LUIGI_CONFIG_PARSER={added}"
)
warnings.warn(msg.format(added=parser, used=PARSER))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does warnings.warn() also write to logs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I use it because warnings.warn used in many other places in project. Yes, warnings can be captured.

@orsinium
Copy link
Contributor Author
orsinium commented Aug 28, 2018

Can someone fix the TravisCI? It has troubles with AWS keys. It's something related to #2171?

@Tarrasch
Copy link
Contributor

Can someone fix the TravisCI? It has troubles with AWS keys. It's something related to #2171?

@dlstadther do you know why there's so many crashes (does the tests rely on external services?).

msg = (
"Parser not installed yet. "
"Please, install luigi with required parser:\n"
"pip install luigi[{parser}]"
Copy link
Contributor

Choose a reason for hiding this comment

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

This can only be toml right? It's fine to hard code it too.

@dlstadther
Copy link
Collaborator

@Tarrasch This AWS client failure just started. I haven't been able to invest the time yet to determine what the issue is. I know we mock boto with moto. But when last updated our moto version, things were still ok. Unless a minor version broke this.

@dlstadther
Copy link
Collaborator

moto version between last passing build and current is the same. However, boto3 increased from 1.7.84 to 1.8.2 and botocore from 1.10.84 to 1.11.2

Last passing build deps
Current failing build deps

@dlstadther
Copy link
Collaborator

Builds are green again. I suspect that the boto issue we were experiencing was a Travis issue.

@dlstadther dlstadther merged commit 38eb6de into spotify:master Sep 1, 2018
dlstadther added a commit to dlstadther/luigi that referenced this pull request Sep 1, 2018
* upstream-master:
  Fix S3Client.copy return value consistency (spotify#2488)
  s3client check for deprecated host keyword and raise error with the details (spotify#2493)
  Fix exception when toml lib is not installed (spotify#2506)
  Add Okko to companies that use luigi (spotify#2512)
  Added optional choice for hdfs clients  (spotify#2487)
  Version 2.7.8
  revert tornado upgrade
  Version 2.7.7
  added a new event 'progress' (spotify#2498)
  Add Uppsala University / pharmb.io as user (spotify#2496)
@orsinium
Copy link
Contributor Author
orsinium commented Sep 1, 2018

Thank you ^^

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.

3 participants
0