Граф коммитов

90 Коммитов

Автор SHA1 Сообщение Дата
Kaxil Naik b420ada05b
[AIRFLOW-5351] Move all GCP Cloud SQL tests in 1 file (#5956) 2019-08-29 23:04:00 +01:00
Cooper Gillan f823a66001 [AIRFLOW-3705] Fix PostgresHook get_conn to use conn_name_attr (#5841)
Update PostgresHook's get_conn method to directly call the specified
conn_name_attr rather that always using self.postgres_conn_id.

Currently subclassing PostgresHook requires overriding the
postgres_conn_id attribute in order to establish a separate connection.

Add an additional unit test for this case checking that the subclassed
PostgresHook's get_conn calls the correct arguments and that the hook
calls the correction connection_id in get_connection.
2019-08-28 14:23:10 +02:00
Tomek 23d104203e [AIRFLOW-5309] Use assert_called_once or has_calls in tests (#5912)
Using mock.assert_call_with method can result in flaky tests
(ex. iterating through dict in python 3.5 which does not
store order of elements). That's why it's better to
use assert_called_once_with or has_calls methods.
2019-08-26 07:03:43 +02:00
Bas Harenslak 5196db38f2 [AIRFLOW-5241] Make all test class names consistent (#5847)
Make all test class names consistent by starting with Test
2019-08-22 14:14:25 +02:00
Tomek dfecb609c4 [AIRFLOW-5255] Move GCP SQL to core (#5861)
This commit moves GCP SQL from contrib to core.
For more information check AIP-21.
2019-08-21 10:57:54 +02:00
Philippe Gagnon 63765487bb [AIRFLOW-5075] Let HttpHook handle connections with empty host fields (#5686) 2019-07-31 09:17:51 +01:00
Ian Truslove 6d34ce291c [AIRFLOW-5022] Fix DockerHook for registries with port numbers (#5644)
`DockerHook` was failing to authenticate with private Docker
registries if the registry's `Connection` specified a non-standard
port number.
2019-07-30 12:25:45 +01:00
Felix Uellendall fc99998212 [AIRFLOW-5057] Provide bucket name to functions in S3 Hook when none is specified (#5674)
Note: The order of arguments has changed for `check_for_prefix`.
The `bucket_name` is now optional. It falls back to the `connection schema` attribute.
- refactor code
- complete docs
2019-07-30 10:05:02 +02:00
Kamil Breguła 96933b0797 [AIRFLOW-4952] Remove unused arguments in tests (#5586) 2019-07-20 11:00:26 +02:00
Kamil Breguła 4f332382da [AIRFLOW-4944] Use new types syntax (#5578) 2019-07-14 07:11:13 +02:00
Ash Berlin-Taylor 6ae5f2b69a
[AIRFLOW-4864] Remove calls to load_test_config (#5502)
We already set the environment variable in the test runner so that
airflow.configuration will do this -- we don't need to do it again
2019-07-01 16:43:03 +01:00
César Reyes 12a2a41466
[AIRFLOW-4849] Add gcp_conn_id to cloudsqldatabehook class to use correctly CloudSqlProxyRunner class (#5478)
* add gcp_conn_id to cloudsqldatabehook

* Modified gcp sql hook test
2019-06-30 14:00:08 +02:00
Kamil Breguła 0d38bf40e5 [AIRFLOW-4837] Fix pylint errors regarding ungrouped imports (#5464) 2019-06-24 00:01:47 +02:00
Jiajie Zhong e6d1f9950c [AIRFLOW-4827] Remove compatible test for python 2 (#5448) 2019-06-21 14:23:38 +08:00
Andrew Harmon 6f684d024e [AIRFLOW-4486] Support IAM Auth in MySqlHook (#5334)
update hook and add new test
2019-05-30 14:14:02 +01:00
Karl Andersson 88564d546c [AIRFLOW-4295] Make `method` attribute case insensitive in HttpHook (#5313)
Make the method: `run` in the HttpHook compare the attribute: 'method' in a case insensitive way.
This resolves the issue where a Httphook created with parameter `method='get'` would not be
treated as a GET-request in the run method and the attribute `params`would be omitted in the Http request.
2019-05-24 23:35:54 +01:00
Andrew Harmon 5be0483959 [AIRFLOW-4557] Add gcp_conn_id parameter to get_sqlproxy_runner() of CloudSqlDatabaseHook (#5314) 2019-05-24 05:58:31 +02:00
Kaxil Naik e47b4bb871 Revert "[AIRFLOW-4295] Make `method` case insensitive in HTTPHook (#5173)"
This reverts commit 58105308d8.
2019-05-19 17:52:41 +01:00
Karl Andersson 58105308d8 [AIRFLOW-4295] Make `method` case insensitive in HTTPHook (#5173)
Make the method: `run` in the HttpHook compare the attribute: 'method' in a case insensitive way.
This resolves the issue where a Httphook created with parameter `method='get'` would not be
treated as a GET-request in the run method and the attribute `params`would be omitted in the Http request.
2019-05-19 17:15:05 +01:00
Chao-Han Tsai 577f893672 [AIRFLOW-4215] Replace mock with unittest.mock (#5292) 2019-05-17 15:40:03 +02:00
albertocalderari 088fd72086 AIRFLOW-4174 Fix run with backoff (#5213)
* AIRFLOW-4174 Fix run with backoff

* AIRFLOW-4174 Fix flake 8 issues
2019-05-13 10:23:27 -07:00
Jacob 355bd56282 [AIRFLOW-3888] HA for metastore connection (#4708)
* HA for Metastore

* [AIRFLOW-3888] HA for metastore connection

Creating a connection to a metasotor with two hosts for high avitablity (eg connection 1, connection 2) is not possible because the entire value entered is taken. For our needs, it is necessary to go through subsequent hosts and connect to the first working.

This change allows you to check and then connect to a working metastor.

* add function to base_hook

* update webhdfs_hook

* back to original version

* back to original version

* Update hive_hooks.py

Thank you. I made a few changes because during the tests I detected several errors.

I have a question, when I do marge to my pull it will be  still possible to land it in the airflow main branch?

* [AIRFLOW-3888] HA for metastore connection 

flake8 code repair

* [AIRFLOW-3888] HA for metastore connection 

Flake8 repair

* [AIRFLOW-3888] HA for metastore connection

Code behavior improvements

* [AIRFLOW-3888] HA for metastore connection 

Add test

* [AIRFLOW-3888] HA for metastore connection

test improvement

* [AIRFLOW-3888] HA for metastore connection

Add test

[AIRFLOW-3888] HA for metastore connection

test improvement

* [AIRFLOW-3888] HA for metastore connection

Add test

[AIRFLOW-3888] HA for metastore connection

test improvement

[AIRFLOW-3888] HA for metastore connection

test improvement

* [AIRFLOW-3888] HA for metastore connection

Improving the typo in the variable name

*  [AIRFLOW-3888] HA for metastore connection

Mock return_value edit

* [AIRFLOW-3888] HA for metastore connection

Flake8 repair

* [AIRFLOW-3888] HA for metastore connection

Test repair

* [AIRFLOW-3888] HA for metastore connection

Flake8 repair

[AIRFLOW-3888] HA for metastore connection

Test repair
2019-05-10 12:45:55 +02:00
Andrew Harmon 373c945873 [AIRFLOW-4417] Add AWS IAM authenication for PostgresHook (#5223)
Enhance the exisitng PostgresHook to allow for IAM authentication for
RDS Postgres and Redshift.
2019-05-03 11:56:19 +01:00
Jiajie Zhong 1e74a94ace [AIRFLOW-4201] Replace unicode strings by normal strings (#5026) 2019-04-30 11:13:33 +02:00
Chao-Han Tsai e62ad5333c [AIRFLOW-4204] Update super() calls (#5143)
Replace super(_class, self) by super() for all files
except ones in _vendor.
2019-04-24 08:16:11 +02:00
Felix Uellendall f4ed214fa4 [AIRFLOW-4211] Add tests for WebHDFSHook (#5015) 2019-04-16 21:59:25 +01:00
BasPH 6970b23396 [AIRFLOW-4259] Move models out of models.py (#5056) 2019-04-09 14:08:34 +02:00
Joshua Carp 0e30793849 [AIRFLOW-4177] Check types in tests (#4994) 2019-03-29 23:03:34 +01:00
Ash Berlin-Taylor 8eaaec638d
[AIRFLOW-3419] Fix S3Hook.select_key on Python3 (#4970) 2019-03-27 15:14:58 +00:00
Jiajie Zhong 1bbc3b8c87 [AIRFLOW-4112] Remove beeline_default in default connection (#4934)
We use both `beeline_default` and `hive_cli_default`
as our default when we run `airflow initdb`. But in
airflow source folder we only use `hive_cli_default`
as conn_id in hive related hook/operator and only
use `beeline_default` in airflow test folder for
test hive hook/operator. That why I think we should
merge then as one default connection

And in [Hive doc](https://cwiki.apache.org/confluence/
display/Hive/LanguageManual+Cli#
LanguageManualCli-DeprecationinfavorofBeelineCLI) could
know that hive cli will be deprecation in favor of
Beeline. In this situation I think we should remove
`beeline_default` and change `hive_cli_default` as
same configure as `beeline_default`
2019-03-23 22:22:02 +01:00
zhongjiajie d665ac19f3 [AIRFLOW-3767] Correct bulk insert function (#4773)
* [AIRFLOW-3767] Correct bulk insert function

Fix Oracle hook bulk_insert bug when
param target_fields is None or rows
is empty iterable

* change without overwriting variables as Fokko said
2019-03-04 15:20:45 +01:00
zhongjiajie 5db902b5dc [AIRFLOW-3881] Correct to_csv row number (#4699) 2019-02-27 16:34:59 +01:00
zhongjiajie 6c64b1da69 [AIRFLOW-3741] Add extra config to Oracle hook (#4584)
Add extra config to Oracle hook including encoding, mode, threaded etc
2019-02-22 16:12:21 +00:00
Joshua Carp 26d775aa20 [AIRFLOW-3789] Fix flake8 3.7 errors. (#4617) 2019-01-30 16:52:19 +00:00
zhongjiajie fa09df5707 [AIRFLOW-3734] Fix hql not run when partition is None (#4561) 2019-01-29 12:49:06 +01:00
Jongyoul Lee f27b5252fe [AIRFLOW-3216] HiveServer2Hook need a password with LDAP authentication (#4057) 2019-01-25 21:21:18 +00:00
Kamil Breguła 304cb9e685 [AIRFLOW-3744] Abandon the use of obsolete aliases of methods (#4568) 2019-01-22 15:45:12 -08:00
Felix ff6ccee748 [AIRFLOW-3594] Unify different License Header 2019-01-11 19:17:20 +01:00
BasPH c9a82d48a3 [AIRFLOW-3458] Move models.Connection into separate file (#4335) 2018-12-20 13:15:37 +01:00
Andy Hadjigeorgiou 77da1cc989 [AIRFLOW-1739] Resolve TestDbApiHook naming ambiguity (#2709) 2018-11-23 12:21:41 +05:30
Jarek Potiuk b5ecb8a78b [AIRFLOW-3268] Better handling of extras field in MySQL connection (#4113) 2018-11-05 16:22:17 +00:00
yangaws bc3108edc1 [AIRFLOW-2524] Update SageMaker hook and operators (#4091)
This re-works the SageMaker functionality in Airflow to be more complete, and more useful for the kinds of operations that SageMaker supports.

We removed some files and operators here, but these were only added after the last release so we don't need to worry about any sort of back-compat.
2018-11-01 20:31:59 +00:00
Jarek Potiuk 92719ac4a7 [AIRFLOW-3265] Support for "unix_socket" extra for MySQL hook (#4110)
MySQL hook does not support "unix_socket" extra - which allows
to specify a different location of Linux socket than the default one.
This is a blocker for tools like cloud-sql-proxy that
creates sockets in an arbitrary place:
https://mysqlclient.readthedocs.io/user_guide.html
2018-10-28 19:27:21 +01:00
Fokko Driesprong 0e8394fd23 [AIRFLOW-3190] Make flake8 compliant (#4035)
Enforce Flake8 over the entire project
2018-10-12 22:22:52 +01:00
Eric Chang a889dfb17b [AIRFLOW-3162] Fix HttpHook URL parse error when port is specified (#4001) 2018-10-07 15:42:15 +01:00
Fokko Driesprong cfad9ce1d9 [AIRFLOW-1390] Update Alembic to 0.9 (#3935) 2018-09-29 08:56:52 +01:00
Joshua Carp 641f49632c [AIRFLOW-3129] Backfill mysql hook unit tests. (#3970) 2018-09-28 10:09:01 -07:00
awelsh93 4f138dfd20 [AIRFLOW-2860] Raise ValueError if timeout < 1 in druid hook 2018-08-07 16:43:54 +02:00
Jasper Kahn 3e7e42f028 [AIRFLOW-2563] Fix PigCliHook Python 3 string/bytes use
Unit tests added for PigCliHook as well to prevent
future issues.

Closes #3594 from jakahn/master
2018-07-27 16:08:32 -07:00
Mike Ascah 8e58053992 [AIRFLOW-2771] Add except type to broad S3Hook try catch clauses
S3Hook will silently fail if given a conn_id that
does not exist. The
calls to check_for_key done by an S3KeySensor will
never fail if the
credentials object is not configured correctly.
This adds the expected
ClientError exception type when performing a HEAD
operation on an
object that doesn't exist to the try catch
statements so that other
exceptions are properly raised.

Closes #3616 from mascah/AIRFLOW-2771-S3hook-
except-type
2018-07-20 13:46:50 +02:00