### Jira
- [x] My PR addresses the following [Airflow
Jira](https://issues.apache.org/jira/browse/AIRFLOW/) issues and references
them in the PR title.
- https://issues.apache.org/jira/browse/AIRFLOW-1998
### Description
- [x] Here are some details about my PR, including screenshots of any UI
changes:
- Added a new Databrick's operator, DatabricksRunNowOperator, for the API's
jobs/run-now functionality.
- After consulting Databricks on their preference, pulled shared code out of
DatabricksSubmitRunOperator into module level functions that both the
DatabricksSubmitRunOperator & DatabricksRunNowOperator call.
- Added required API call to databricks_hook.py
- Added/updated tests for both databricks_operators.py and the
databricks_hook.py
- Fixed a connection state issue with tokens in the setUp part of the
operator tests where conn.extras wasn't getting reset between test runs and
maintaining its mock token.
- Fixed some existing indentation for flake8
### Tests
- [x] My PR adds the following unit tests:
- I mirrored the same tests that the existing DatabricksSubmitRunOperator had
for the new DatabricksRunNowOperator.
- **Added**:
tests/contrib/operators/test_databricks_operator.py
* DatabricksOperatorSharedFunctions
* test_deep_string_coerce
* DatabricksRunNowOperatorTest
* test_init_with_named_parameters
* test_init_with_json
* test_init_with_merging
* test_init_with_templating
* test_init_with_bad_type
* test_exec_success
* test_exec_failure
* test_on_kill
- **Updated**:
tests/contrib/operators/test_databricks_operator.py
* DatabricksSubmitRunOperatorTest
* test_init_with_named_parameters
* test_init_with_json
* test_init_with_merging
* test_init_with_templating
* test_init_with_bad_type
* test_exec_success
* test_exec_failure
* test_on_kill
- **Removed**:
tests/contrib/operators/test_databricks_operator.py
* DatabricksSubmitRunOperatorTest
* test_deep_string_coerce (it was moved to its own external
test class)
### 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.
### Code Quality
- [x] Passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
[ Full content available at:
https://github.com/apache/incubator-airflow/pull/3813 ]
This message was relayed via gitbox.apache.org for [email protected]