Skip to content

Instantly share code, notes, and snippets.

@tszumowski
Last active March 19, 2019 10:22
Show Gist options
  • Save tszumowski/6b14d8f8274d4be1033d83a8ac30973a to your computer and use it in GitHub Desktop.
Save tszumowski/6b14d8f8274d4be1033d83a8ac30973a to your computer and use it in GitHub Desktop.
Airflow DatastoreExportOperator Snippet
class DatastoreExportOperator(BaseOperator):
""" (...) """
@apply_defaults
def __init__(self,
bucket,
namespace=None,
datastore_conn_id='google_cloud_default',
(...)
overwrite_existing=False,
*args,
**kwargs):
super(DatastoreExportOperator, self).__init__(*args, **kwargs)
self.datastore_conn_id = datastore_conn_id
(...)
if kwargs.get('xcom_push') is not None:
raise AirflowException("'xcom_push' was deprecated, use 'BaseOperator.do_xcom_push' instead")
@tszumowski
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment