Skip to content

Commit

Permalink
Fix tests with latest fromconfig + fix config types (#3)
Browse files Browse the repository at this point in the history
* Improve robustness for none and empty config edge cases

* Fix tests with latest fromconfig + fix config types

* Fix type annotation
  • Loading branch information
guillaumegenthial authored Apr 29, 2021
1 parent 6e1fd88 commit a45af44
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org).


## [0.1.1] - 2021-04-29

### Added
### Changed
### Deprecated
### Removed
### Fixed
- Better handling for config types (extract params more carefully).

### Security


## [0.1.0] - 2021-04-20

### Added
Expand Down
2 changes: 1 addition & 1 deletion fromconfig_yarn/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, launcher: fromconfig.launcher.Launcher = None):
def __call__(self, config: Any, command: str = ""):
"""Run code on yarn."""
# Extract params from the yarn entry of the config
params = config.get("yarn", {})
params = (config.get("yarn") or {}) if fromconfig.utils.is_mapping(config) else {} # type: ignore
env_vars = params.get("env_vars", _DEFAULT_ENV_VARS)
hadoop_file_systems = params.get("hadoop_file_systems", ())
ignored_packages = params.get("ignored_packages", ())
Expand Down
2 changes: 1 addition & 1 deletion fromconfig_yarn/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pylint: disable=all

__version__ = "0.1.0"
__version__ = "0.1.1"
__author__ = "Criteo"


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ def _monkey_submit_func(func, args, **kwargs):
monkeypatch.setattr(skein_launcher, "submit_func", _monkey_submit_func)

config = {"run": None, "launcher": {"run": "yarn"}, "yarn": yarn}
launcher = fromconfig.launcher.Launcher.fromconfig(config["launcher"])
launcher = fromconfig.launcher.DefaultLauncher.fromconfig(config["launcher"])
launcher(config, "run")
assert got["ran"]

0 comments on commit a45af44

Please sign in to comment.