[
https://issues.apache.org/jira/browse/AIRFLOW-3758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16753438#comment-16753438
]
ASF GitHub Bot commented on AIRFLOW-3758:
-----------------------------------------
ttanay commented on pull request #4601: [WIP][AIRFLOW-3758] Fix circular import
in WasbTaskHandler
URL: https://github.com/apache/airflow/pull/4601
Make sure you have checked _all_ steps below.
### Jira
- [ ] My PR addresses the following [Airflow
Jira](https://issues.apache.org/jira/browse/AIRFLOW/) issues and references
them in the PR title. For example, "\[AIRFLOW-XXX\] My Airflow PR"
- https://issues.apache.org/jira/browse/AIRFLOW-3758
- In case you are fixing a typo in the documentation you can prepend your
commit with \[AIRFLOW-XXX\], code changes always need a Jira issue.
### Description
Import for WasbHook in WasbTaskHandler was causing a circular import when
configure_logging() was called.
Closes [AIRFLOW-3758].
### Tests
- [ ] My PR adds the following unit tests __OR__ does not need testing for
this extremely good reason:
**Adding Tests..**
### Commits
- [X] My commits all reference Jira issues in their subject lines, and I
have squashed multiple commits if they address the same issue. In addition, my
commits follow the guidelines from "[How to write a good git commit
message](http://chris.beams.io/posts/git-commit/)":
1. Subject is separated from body by a blank line
1. Subject is limited to 50 characters (not including Jira issue reference)
1. Subject does not end with a period
1. Subject uses the imperative mood ("add", not "adding")
1. Body wraps at 72 characters
1. Body explains "what" and "why", not "how"
### Documentation
- [X] In case of new functionality, my PR adds documentation that describes
how to use it.
- When adding new operators/hooks/sensors, the autoclass documentation
generation needs to be added.
- All the public functions and the classes in the PR contain docstrings
that explain what it does
### Code Quality
- [ ] Passes `flake8`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Airflow command fails when remote logging enabled to azure blob
> ---------------------------------------------------------------
>
> Key: AIRFLOW-3758
> URL: https://issues.apache.org/jira/browse/AIRFLOW-3758
> Project: Apache Airflow
> Issue Type: Bug
> Components: logging
> Affects Versions: 1.10.2
> Reporter: Marko Kattelus
> Assignee: Tanay Tummalapalli
> Priority: Major
>
> I tried to update to 1.10.2 but when running
> {code:java}
> airflow initdb
> {code}
> I get following:
> {code:java}
> webserver_1 | Updating database
> webserver_1 | Unable to load the config, contains a configuration error.
> webserver_1 | Traceback (most recent call last):
> webserver_1 | File "/usr/local/lib/python3.6/logging/config.py", line 390, in
> resolve
> webserver_1 | found = getattr(found, frag)
> webserver_1 | AttributeError: module 'airflow.utils.log' has no attribute
> 'wasb_task_handler'
> webserver_1 |
> webserver_1 | During handling of the above exception, another exception
> occurred:
> webserver_1 |
> webserver_1 | Traceback (most recent call last):
> webserver_1 | File "/usr/local/lib/python3.6/logging/config.py", line 392, in
> resolve
> webserver_1 | self.importer(used)
> webserver_1 | File
> "/usr/local/lib/python3.6/site-packages/airflow/utils/log/wasb_task_handler.py",
> line 23, in <module>
> webserver_1 | from airflow.contrib.hooks.wasb_hook import WasbHook
> webserver_1 | File
> "/usr/local/lib/python3.6/site-packages/airflow/contrib/hooks/wasb_hook.py",
> line 22, in <module>
> webserver_1 | from airflow.hooks.base_hook import BaseHook
> webserver_1 | File
> "/usr/local/lib/python3.6/site-packages/airflow/hooks/base_hook.py", line 28,
> in <module>
> webserver_1 | from airflow.models import Connection
> webserver_1 | File
> "/usr/local/lib/python3.6/site-packages/airflow/models.py", line 86, in
> <module>
> webserver_1 | from airflow.utils.dag_processing import list_py_file_paths
> webserver_1 | File
> "/usr/local/lib/python3.6/site-packages/airflow/utils/dag_processing.py",
> line 49, in <module>
> webserver_1 | from airflow.settings import logging_class_path
> webserver_1 | ImportError: cannot import name 'logging_class_path'
> webserver_1 |
> webserver_1 | The above exception was the direct cause of the following
> exception:
> webserver_1 |
> webserver_1 | Traceback (most recent call last):
> webserver_1 | File "/usr/local/lib/python3.6/logging/config.py", line 565, in
> configure
> webserver_1 | handler = self.configure_handler(handlers[name])
> webserver_1 | File "/usr/local/lib/python3.6/logging/config.py", line 715, in
> configure_handler
> webserver_1 | klass = self.resolve(cname)
> webserver_1 | File "/usr/local/lib/python3.6/logging/config.py", line 399, in
> resolve
> webserver_1 | raise v
> webserver_1 | File "/usr/local/lib/python3.6/logging/config.py", line 392, in
> resolve
> webserver_1 | self.importer(used)
> webserver_1 | File
> "/usr/local/lib/python3.6/site-packages/airflow/utils/log/wasb_task_handler.py",
> line 23, in <module>
> webserver_1 | from airflow.contrib.hooks.wasb_hook import WasbHook
> webserver_1 | File
> "/usr/local/lib/python3.6/site-packages/airflow/contrib/hooks/wasb_hook.py",
> line 22, in <module>
> webserver_1 | from airflow.hooks.base_hook import BaseHook
> webserver_1 | File
> "/usr/local/lib/python3.6/site-packages/airflow/hooks/base_hook.py", line 28,
> in <module>
> webserver_1 | from airflow.models import Connection
> webserver_1 | File
> "/usr/local/lib/python3.6/site-packages/airflow/models.py", line 86, in
> <module>
> webserver_1 | from airflow.utils.dag_processing import list_py_file_paths
> webserver_1 | File
> "/usr/local/lib/python3.6/site-packages/airflow/utils/dag_processing.py",
> line 49, in <module>
> webserver_1 | from airflow.settings import logging_class_path
> webserver_1 | ValueError: Cannot resolve
> 'airflow.utils.log.wasb_task_handler.WasbTaskHandler': cannot import name
> 'logging_class_path'
> webserver_1 |
> webserver_1 | During handling of the above exception, another exception
> occurred:
> webserver_1 |
> webserver_1 | Traceback (most recent call last):
> webserver_1 | File "/usr/local/bin/airflow", line 21, in <module>
> webserver_1 | from airflow import configuration
> webserver_1 | File
> "/usr/local/lib/python3.6/site-packages/airflow/__init__.py", line 36, in
> <module>
> webserver_1 | from airflow import settings, configuration as conf
> webserver_1 | File
> "/usr/local/lib/python3.6/site-packages/airflow/settings.py", line 262, in
> <module>
> webserver_1 | logging_class_path = configure_logging()
> webserver_1 | File
> "/usr/local/lib/python3.6/site-packages/airflow/logging_config.py", line 72,
> in configure_logging
> webserver_1 | raise e
> webserver_1 | File
> "/usr/local/lib/python3.6/site-packages/airflow/logging_config.py", line 67,
> in configure_logging
> webserver_1 | dictConfig(logging_config)
> webserver_1 | File "/usr/local/lib/python3.6/logging/config.py", line 802, in
> dictConfig
> webserver_1 | dictConfigClass(config).configure()
> webserver_1 | File "/usr/local/lib/python3.6/logging/config.py", line 573, in
> configure
> webserver_1 | '%r: %s' % (name, e))
> webserver_1 | ValueError: Unable to configure handler 'processor': Cannot
> resolve 'airflow.utils.log.wasb_task_handler.WasbTaskHandler': cannot import
> name 'logging_class_path'
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)