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

4496 Коммитов

Автор SHA1 Сообщение Дата
Ash Berlin-Taylor 2d5408935f [AIRFLOW-1839] Fix more bugs in S3Hook boto -> boto3 migration
There were some more bugs as a result of the boto
to boto3 migration
that weren't covered by existing tests. Now they
are fixed, and covered.
Hopefully I got everything this time.

Closes #2805 from ashb/AIRFLOW-1839-s3
-hook_loadsa-tests
2017-11-22 15:03:15 +01:00
Guillermo Rodríguez Cano 6b1ceff7d2 [AIRFLOW-1830] Support multiple domains in Google authentication backend
Closes #2797 from wileeam/multiple-domains-google-
auth
2017-11-21 07:48:24 +01:00
Daniel van der Ende e4675ae83e [AIRFLOW-1831] Add driver-classpath spark submit
Add the ability to set the driver-classpath for
the spark_submit
operator and hook.

Closes #2800 from danielvdende/add-spark-driver-
classpath
2017-11-20 16:00:48 +01:00
Ash Berlin-Taylor 98df0d6e3b [AIRFLOW-1795] Correctly call S3Hook after migration to boto3
In the migration of S3Hook to boto3 the connection
ID parameter changed
to `aws_conn_id`. This fixes the uses of
`s3_conn_id` in the code base
and adds a note to UPDATING.md about the change.

In correcting the tests for S3ToHiveTransfer I
noticed that
S3Hook.get_key was returning a dictionary, rather
then the S3.Object as
mentioned in it's doc string. The important thing
that was missing was
ability to get the key name from the return a call
to get_wildcard_key.

Closes #2795 from
ashb/AIRFLOW-1795-s3hook_boto3_fixes
2017-11-18 14:07:38 +01:00
Fokko Driesprong 54c03f3262 [AIRFLOW-1811] Fix render Druid operator
Set the correct fields to enable the visualisation
of the rendering
of the Druid indexing spec. Add some tests to make
sure that the
templating is working :-)

Closes #2783 from Fokko/AIRFLOW-1811-fix-druid-
operator
2017-11-16 09:03:33 +01:00
Kevin Yang 3c8f7747b0 [AIRFLOW-1819] Fix slack operator unittest bug
Fix failing slack operator unittest and add test
coverage.

Closes #2791 from yrqls21/kevin-yang-fix-unit-test
2017-11-15 17:52:09 -08:00
Kevin Yang d8e8f90142 [AIRFLOW-1805] Allow Slack token to be passed through connection
Allow users to pass in Slack token through
connection which can provide better security. This
enables user to expose token only to workers
instead to both workers and schedulers.

Closes #2789 from
yrqls21/add_conn_supp_in_slack_op
2017-11-15 14:53:58 -08:00
Dan Sedov d04519e605 [AIRFLOW-1816] Add region param to Dataproc operators
Closes #2788 from DanSedov/master
2017-11-15 12:05:06 -08:00
Adam Boscarino d8fa2e9049 [AIRFLOW-868] Add postgres_to_gcs operator and unittests
Adds a postgres_to_gcs operator to contrib so that a user can copy a
dump from postgres to google cloud storage. Tests write to local
NamedTemporayFiles so we correctly test serializing encoded ndjson in
both python3 and python2.7.
2017-11-15 14:34:59 -05:00
Devon Peticolas 2f79610a3e [AIRFLOW-1613] make mysql_to_gcs_operator py3 compatible
Uses `__future__.unicode_literals` and replaces calling `json.dumps`
with `json.dump` followed by `tmp_file_handle.write` to write json lines
to the ndjson file. When using python3, `json.dump` will return a
unicode string instead of a byte string, therefore we encode the unicode
string to `utf-8` which is compatible with bigquery (see:
https://cloud.google.com/bigquery/docs/loading-data#loading_encoded_data).
2017-11-15 14:00:02 -05:00
Cedrik Neumann 5157b5a763 [AIRFLOW-1817] use boto3 for s3 dependency
Since S3Hook is reimplemented based on the AwsHook
using boto3, its package dependencies need to be
updated as well.

Closes #2790 from m1racoli/fix-setup-s3
2017-11-15 11:55:13 +01:00
Rob Keevil d4d8eb9326 [AIRFLOW-1813] Bug SSH Operator empty buffer
The SSH Operator will throw an empty "SSH operator
error" when running
commands that do not immediately log something to
the terminal. This is
due to a call to stdout.channel.recv when the
channel currently has a
0-size buffer, either because the command has not
yet logged anything,
or never will (e.g. sleep 5)

Make code PEP8 compliant

Closes #2785 from RJKeevil/fix-ssh-operator-no-
terminal-output
2017-11-13 16:01:15 +01:00
Bolke de Bruin 9ec7f0f04b [AIRFLOW-1801][AIRFLOW-288] Url encode execution dates
Execution dates can contain special characters
that
need to be url encoded. In case of timezone
information
this information is lost if not url encoded.

Closes #2779 from bolkedebruin/AIRFLOW-1801
2017-11-12 16:01:19 +01:00
Niels Zeilemaker faa9a5266c [AIRFLOW-1563] Catch OSError while symlinking the latest log directory
Closes #2564 from NielsZeilemaker/AIRFLOW-1563
2017-11-10 09:03:00 +01:00
Daniel Huang f5f7701258 [AIRFLOW-1794] Remove uses of Exception.message for Python 3
Closes #2766 from dhuang/AIRFLOW-1794
2017-11-10 08:57:22 +01:00
Ryan Buckley f14f8558be [AIRFLOW-1799] Fix logging line which raises errors
Closes #2777 from ryancbuckley/log-syntax-fix
2017-11-10 08:52:21 +01:00
Brian Charous cbb00d4055 [AIRFLOW-1102] Upgrade Gunicorn >=19.4.0
Closes #2775 from briancharous/upgrade-gunicorn
2017-11-10 08:49:41 +01:00
Ash Berlin-Taylor 715602ce6a [AIRFLOW-1756] Fix S3TaskHandler to work with Boto3-based S3Hook
The change from boto2 to boto3 in S3Hook caused
this to break (the
return type of `hook.get_key()` changed. There's a
better method
designed for that we should use anyway.

This wasn't caught by the tests as the mocks
weren't updated. Rather
than mocking the return of the hook I have changed
it to use "moto"
(already in use elsewhere in the tests) to mock at
the S3 layer, not
our hook.

Closes #2773 from ashb/AIRFLOW-1756-s3-logging-
boto3-fix
2017-11-09 21:57:04 +01:00
Ash Berlin-Taylor 28411b1e7e [AIRFLOW-1797] S3Hook.load_string didn't work on Python3
With the switch to Boto3 we now need the content
to be bytes, not a
string. On Python2 there is no difference, but for
Python3 this matters.

And since there were no real tests covering the
S3Hook I've added some
basic ones.

Closes #2771 from ashb/AIRFLOW-1797
2017-11-09 20:47:08 +01:00
William Pursell 9425d359b0 [AIRFLOW-646] Add docutils to setup_requires
python-daemon declares its docutils dependency in a setup_requires
clause, and 'python setup.py install' fails since it misses
that dependency.

Closes #2765 from wrp/docutils
2017-11-09 09:15:12 -08:00
Fokko Driesprong 3eb2dd86b9 [AIRFLOW-1792] Missing intervals DruidOperator
The DruidOperator allows you to template the
intervals field which is
important when you are doing backfills with Druid.
This field was
missing in the constructor and Airflow threw a
warning

Closes #2764 from Fokko/patch-1
2017-11-08 19:40:21 +01:00
Ignasi Peiró 1943a96e70 [AIRFLOW-1789][AIRFLOW-1712] Log SSHOperator stderr to log.warning
Logging functionality for SSHOperator was added in
[AIRFLOW-1712] but it
only logged stdout.
This commit also logs stderr to log.warning

Closes #2761 from OpringaoDoTurno/stderr_in_ssh
2017-11-08 19:38:39 +01:00
Kevin Yang 313f5bac4a [AIRFLOW-1787] Fix task instance batch clear and set state bugs
Fixes Batch clear in Task Instances view is not working
for task instances in RUNNING state and all batch
operations in Task instances view cannot work when
manually triggered task instances are selected
because they have a different execution date
format.

Closes #2759 from yrqls21/fix-ti-batch-clear-n
-set-state-bugs
2017-11-07 11:23:00 -08:00
Dan Davydov 1a7b63eb16 [AIRFLOW-1780] Fix long output lines with unicode from hanging parent
Fix long task output lines with unicode from
hanging parent process. Tasks that create output
that gets piped into a file in the parent airflow
process would hang if they had long lines with
unicode characters.

Closes #2758 from aoen/ddavydov--
fix_unicode_output_string
2017-11-06 16:02:02 -08:00
Bolke de Bruin 3fde1043fe Merge pull request #2628 from moertel/registry-login 2017-11-02 19:09:12 +01:00
Stephan Erb 7765278479 [AIRFLOW-387] Close SQLAlchemy sessions properly
This commit adopts the `provide_session` helper in
almost the entire
codebase. This ensures session are handled and
closed consistently.
In particular, this ensures we don't forget to
close and thus leak
database connections.

As an additional change, the `provide_session`
helper has been extended
to also rollback and close created connections
under error conditions.

As an additional helper, this commit also
introduces a contextmanager
that provides the same functionality as the
`provide_session`
decorator. This is helpful in cases where the
scope of a session should
be smaller than the entire method where it is
being used.

Closes #2739 from StephanErb/session_close
2017-11-02 18:59:34 +01:00
Rob Keevil 1bde783385 [AIRFLOW-1779] Add keepalive packets to ssh hook
Make use of paramiko's set_keepalive method to
send keepalive packets every
keepalive_interval seconds.  This will prevent
long running queries with no terminal
output from being termanated as idle, for example
by an intermediate NAT.

Set on by default with a 30 second interval.

Closes #2749 from RJKeevil/add-sshhook-keepalive
2017-11-02 18:57:09 +01:00
Stefanie Grunwald a61d9444cd
[AIRFLOW-1669] Fix Docker and pin Moto to 1.1.19
https://github.com/spulec/moto/pull/1048 introduced `docker` as a
dependency in Moto, causing a conflict as Airflow uses `docker-py`. As
both packages don't work together, Moto is pinned to the version
prior to that change.
2017-11-02 14:23:32 +01:00
Stefanie Grunwald f101ff0063
[AIRFLOW-71] Add support for private Docker images
Pulling images from private Docker registries requires authentication,
so additional parameters are added in order to perform the login step.
2017-11-02 13:46:57 +01:00
Thomas Smith 2fef9152be [AIRFLOW-XXX] Give a clue what the 'ds' variable is
It's not explained anywhere else in the
tutorial...

Closes #2679 from tgs/patch-1
2017-11-02 12:58:25 +01:00
Aaron Myatt 54f1b77f99 [AIRFLOW-XXX] Correct typos in the faq docs page
Closes #2735 from aaronmyatt/correct-typos-in-faq-
page
2017-11-02 12:56:37 +01:00
sid.gupta cc01b7df3d [AIRFLOW-1571] Add AWS Lambda Hook
Closes #2718 from sid88in/feature/aws_lambda_hook2
2017-11-02 12:53:39 +01:00
Charlie Jones a5f51cc4a8 [AIRFLOW-1675] Fix docstrings for API docs
Some docstrings were missing spaces, causing them
to render strangely
in documentation. This corrects the issue by
adding in the spaces.

Closes #2667 from cjonesy/master
2017-11-02 12:51:06 +01:00
Ignasi Peiró 0ba6ab6e5c [AIRFLOW-1712][AIRFLOW-756][AIRFLOW-751] Log SSHOperator output
SSHOperator does now write stdout to log, just
like SSHExecutorOperator
did in the past

Closes #2686 from OpringaoDoTurno/bring-ssh-logs-
back
2017-11-02 09:34:44 +01:00
Bolke de Bruin 5b06b66662 [AIRFLOW-1776] Capture stdout and stderr for logging
The new logging framework was not properly
capturing stdout/stderr
output. Redirection the the correct logging
facility is required.

Closes #2745 from bolkedebruin/redirect_std
2017-11-01 23:39:52 +01:00
Ash Berlin-Taylor 0e27e1b209 [AIRFLOW-1765] Make experimental API securable without needing Kerberos.
Previously the experimental API was either wide-
open only (allow any
request) or secured behind Kerberos. This adds a
third option of
deny-all.

Closes #2737 from ashb/exp-api-securable
2017-11-01 15:38:36 +01:00
Ash Berlin-Taylor 0bf7adb209 [AIRFLOW-1764] The web interface should not use the experimental API
The web interface should not use the experimental
api as the
authentication options differ between the two.
Additionally, rather than
having an API call to get the last run data we can
easily include it in
the generated HMTL response. One less round-trip,
less endpoints, and
less time before the page has fully rendered.

This is based original off @NielsZeilemaker's PR
for the same Jira
issue (#2734)

Closes #2738 from ashb/no-exp-api-from-web-
interface
2017-11-01 15:25:28 +01:00
Alex Guziel 6b8fe98574 [AIRFLOW-1771] Rename heartbeat to avoid confusion
Closes #2743 from saguziel/aguziel-heartbeat
2017-10-31 14:59:05 -07:00
Alex Guziel 52f8d7da9d [AIRFLOW-1769] Add support for templates in VirtualenvOperator
Closes #2741 from saguziel/aguziel-virtualenv-
templates
2017-10-31 14:57:55 -07:00
Andy Hadjigeorgiou 44710d7e9e [AIRFLOW-1763] Fix S3TaskHandler unit tests
Fix breaking S3TaskHandler unit tests, and create
a package so that
tests are identified by CI.

Closes #2732 from andyxhadji/AIRFLOW-1763
2017-10-31 19:32:13 +01:00
Sumit Maheshwari c5776375fd [AIRFLOW-1315] Add Qubole File & Partition Sensors
Closes #2401 from msumit/AIRFLOW-1315
2017-10-31 19:32:07 +05:30
Bolke de Bruin 4ee4e474b8 [AIRFLOW-1018] Make processor use logging framework
Until now, the dga processor had its own logging
implementation,
making it hard to adjust for certain use cases
like working
in a container.

This patch moves everything to the standard
logging framework.

Closes #2728 from bolkedebruin/AIRFLOW-1018
2017-10-30 20:40:12 +01:00
Andy Hadjigeorgiou 4fb7a90b36 [AIRFLOW-1695] Add RedshiftHook using boto3
Adds RedshiftHook class, allowing for management
of AWS Redshift
clusters and snapshots using boto3 library. Also
adds new test file and
unit tests for class methods.

Closes #2717 from andyxhadji/1695
2017-10-30 20:36:18 +01:00
k.privezentsev c800632bb4 [AIRFLOW-1706] Fix query error for MSSQL backend
MSSQL doesn't support key word 'is' as synonym for
'='

Closes #2733 from
patsak/fix/illegal_query_for_mssql
2017-10-30 20:06:55 +01:00
Bolke de Bruin abcf1d584c [AIRFLOW-1711] Use ldap3 dict for group membership
Certain schemas for group membership return a
string
instead of a list. Instead of using a check we now
use the entries API from ldap3.

Closes #2731 from bolkedebruin/AIRFLOW-1711
2017-10-30 19:35:10 +01:00
fenglu-g 574e1c63d9 [AIRFLOW-1723] Make sendgrid a plugin
Closes #2727 from fenglu-g/master
2017-10-30 10:55:30 -07:00
Tomasz Bartczak b3c247d3bf [AIRFLOW-1757] Add missing options to SparkSubmitOperator
add 'exclude-packages' and 'repositories' as
options
to SparkSubmitOperator as they were missing

Closes #2725 from kretes/AIRFLOW-1757-spark-new-
options
2017-10-28 15:13:07 +02:00
Ace Haidrey 1d531555ec [AIRFLOW-1734][Airflow 1734] Sqoop hook/operator enhancements
Closes #2703 from Acehaidrey/sqoop_contrib_fixes
2017-10-28 15:07:56 +02:00
Martial Hue efdc4d3b41 [AIRFLOW-1761] Fix type in scheduler.rst
Closes #2707 from mhue/patch-1
2017-10-27 08:17:36 -07:00
Fokko Driesprong 635ab01a76 [AIRFLOW-1731] Set pythonpath for logging
Before initializing the logging framework, we want
to set the python
path so the logging config can be found.

Closes #2721 from Fokko/AIRFLOW-1731-import-
pythonpath
2017-10-27 16:02:56 +02:00