You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "krishnabhupatiraju (JIRA)" <ji...@apache.org> on 2017/02/14 00:06:41 UTC

[jira] [Created] (AIRFLOW-873) PR 2012 forcing availability of hive_metastore

krishnabhupatiraju created AIRFLOW-873:
------------------------------------------

             Summary: PR 2012 forcing availability of hive_metastore
                 Key: AIRFLOW-873
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-873
             Project: Apache Airflow
          Issue Type: Bug
            Reporter: krishnabhupatiraju
            Assignee: krishnabhupatiraju
            Priority: Minor


PR 2012 leads to an attempt to import hive_metastore any time unit tests are run, even if these aren't the unit tests being run. hive_metastore is not a required module for Airflow, but now any machine without it can't run any local unit tests! I put the traceback I'm seeing below.

The unit test file causing this import needs to be guarded so it only runs in if its dependencies are available (see hive_operator.py in the same tests directory for one example, or the explicit skip guards in the postgres/mysql tests that ensure they only run in the right travis environment).

======================================================================
ERROR: Failure: ImportError (No module named 'hive_metastore')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/jlowin/anaconda3/lib/python3.5/site-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/Users/jlowin/anaconda3/lib/python3.5/site-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/Users/jlowin/anaconda3/lib/python3.5/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/Users/jlowin/anaconda3/lib/python3.5/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/Users/jlowin/anaconda3/lib/python3.5/imp.py", line 244, in load_module
    return load_package(name, filename)
  File "/Users/jlowin/anaconda3/lib/python3.5/imp.py", line 216, in load_package
    return _load(spec)
  File "<frozen importlib._bootstrap>", line 693, in _load
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 665, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/Users/jlowin/git/airflow/tests/__init__.py", line 24, in <module>
    from .operators import *
  File "/Users/jlowin/git/airflow/tests/operators/__init__.py", line 20, in <module>
    from .s3_to_hive_operator import *
  File "/Users/jlowin/git/airflow/tests/operators/s3_to_hive_operator.py", line 25, in <module>
    from airflow.operators.s3_to_hive_operator import S3ToHiveTransfer
  File "/Users/jlowin/git/airflow/airflow/operators/s3_to_hive_operator.py", line 27, in <module>
    from airflow.hooks.hive_hooks import HiveCliHook
  File "/Users/jlowin/git/airflow/airflow/hooks/hive_hooks.py", line 28, in <module>
    import hive_metastore
ImportError: No module named 'hive_metastore'



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)