Skip to content

Commit

Permalink
Remove deprecated hdfs->use_snakebite config
Browse files Browse the repository at this point in the history
It have been deprecated for a while now and is superseded by using
hdfs->client.
  • Loading branch information
Tarrasch committed Apr 15, 2015
1 parent dc64b2b commit 81878d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
3 changes: 0 additions & 3 deletions doc/configuration.rst
Expand Up @@ -282,9 +282,6 @@ snakebite_autoconfig
If true, attempts to automatically detect the host and port of the
namenode for snakebite queries. Defaults to false.

use_snakebite
DEPRECATED - use client instead


[hive]
------
Expand Down
16 changes: 3 additions & 13 deletions luigi/hdfs.py
Expand Up @@ -49,8 +49,7 @@ class hdfs(luigi.Config):
snakebite_autoconfig = luigi.BoolParameter(default=False)
namenode_host = luigi.Parameter(default=None)
namenode_port = luigi.IntParameter(default=None)
client = luigi.Parameter(default=None)
use_snakebite = luigi.BoolParameter(default=False)
client = luigi.Parameter(default='hadoopcli')
tmp_dir = luigi.Parameter(config_path=dict(section='core', name='hdfs-tmp-dir'), default=None)


Expand Down Expand Up @@ -630,24 +629,15 @@ def get_configured_hdfs_client(show_warnings=True):
"snakebite_with_hadoopcli_fallback",
"snakebite",
]
if six.PY3 and (custom in conf_usinf_snakebite or config.use_snakebite):
if six.PY3 and (custom in conf_usinf_snakebite):
if show_warnings:
warnings.warn(
"snakebite client not compatible with python3 at the moment"
"falling back on hadoopcli",
stacklevel=2
)
return "hadoopcli"
if custom:
# Eventually this should be the only valid code path
return custom
if config.use_snakebite:
if show_warnings:
warnings.warn("Deprecated: Just specify 'client: snakebite' in config")
return "snakebite"
if show_warnings:
warnings.warn("Deprecated: Specify 'client: hadoopcli' in config")
return "hadoopcli" # The old default when not specified
return custom


def create_hadoopcli_client():
Expand Down

0 comments on commit 81878d6

Please sign in to comment.