apache-airflow-providers-teradata 2.2.0rc1__tar.gz → 2.3.0rc1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (14) hide show
  1. {apache_airflow_providers_teradata-2.2.0rc1 → apache_airflow_providers_teradata-2.3.0rc1}/PKG-INFO +6 -6
  2. {apache_airflow_providers_teradata-2.2.0rc1 → apache_airflow_providers_teradata-2.3.0rc1}/README.rst +3 -3
  3. {apache_airflow_providers_teradata-2.2.0rc1 → apache_airflow_providers_teradata-2.3.0rc1}/airflow/providers/teradata/LICENSE +4 -4
  4. {apache_airflow_providers_teradata-2.2.0rc1 → apache_airflow_providers_teradata-2.3.0rc1}/airflow/providers/teradata/__init__.py +1 -1
  5. {apache_airflow_providers_teradata-2.2.0rc1 → apache_airflow_providers_teradata-2.3.0rc1}/airflow/providers/teradata/get_provider_info.py +2 -2
  6. {apache_airflow_providers_teradata-2.2.0rc1 → apache_airflow_providers_teradata-2.3.0rc1}/airflow/providers/teradata/operators/teradata.py +1 -1
  7. {apache_airflow_providers_teradata-2.2.0rc1 → apache_airflow_providers_teradata-2.3.0rc1}/airflow/providers/teradata/transfers/azure_blob_to_teradata.py +32 -14
  8. {apache_airflow_providers_teradata-2.2.0rc1 → apache_airflow_providers_teradata-2.3.0rc1}/airflow/providers/teradata/transfers/s3_to_teradata.py +20 -8
  9. {apache_airflow_providers_teradata-2.2.0rc1 → apache_airflow_providers_teradata-2.3.0rc1}/pyproject.toml +3 -3
  10. {apache_airflow_providers_teradata-2.2.0rc1 → apache_airflow_providers_teradata-2.3.0rc1}/airflow/providers/teradata/hooks/__init__.py +0 -0
  11. {apache_airflow_providers_teradata-2.2.0rc1 → apache_airflow_providers_teradata-2.3.0rc1}/airflow/providers/teradata/hooks/teradata.py +0 -0
  12. {apache_airflow_providers_teradata-2.2.0rc1 → apache_airflow_providers_teradata-2.3.0rc1}/airflow/providers/teradata/operators/__init__.py +0 -0
  13. {apache_airflow_providers_teradata-2.2.0rc1 → apache_airflow_providers_teradata-2.3.0rc1}/airflow/providers/teradata/transfers/__init__.py +0 -0
  14. {apache_airflow_providers_teradata-2.2.0rc1 → apache_airflow_providers_teradata-2.3.0rc1}/airflow/providers/teradata/transfers/teradata_to_teradata.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: apache-airflow-providers-teradata
3
- Version: 2.2.0rc1
3
+ Version: 2.3.0rc1
4
4
  Summary: Provider package apache-airflow-providers-teradata for Apache Airflow
5
5
  Keywords: airflow-provider,teradata,airflow,integration
6
6
  Author-email: Apache Software Foundation <dev@airflow.apache.org>
@@ -29,8 +29,8 @@ Requires-Dist: apache-airflow-providers-amazon ; extra == "amazon"
29
29
  Requires-Dist: apache-airflow-providers-common-sql ; extra == "common.sql"
30
30
  Requires-Dist: apache-airflow-providers-microsoft-azure ; extra == "microsoft.azure"
31
31
  Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
32
- Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-teradata/2.2.0/changelog.html
33
- Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-teradata/2.2.0
32
+ Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-teradata/2.3.0/changelog.html
33
+ Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-teradata/2.3.0
34
34
  Project-URL: Slack Chat, https://s.apache.org/airflow-slack
35
35
  Project-URL: Source Code, https://github.com/apache/airflow
36
36
  Project-URL: Twitter, https://twitter.com/ApacheAirflow
@@ -83,7 +83,7 @@ Provides-Extra: microsoft.azure
83
83
 
84
84
  Package ``apache-airflow-providers-teradata``
85
85
 
86
- Release: ``2.2.0.rc1``
86
+ Release: ``2.3.0.rc1``
87
87
 
88
88
 
89
89
  `Teradata <https://www.teradata.com/>`__
@@ -96,7 +96,7 @@ This is a provider package for ``teradata`` provider. All classes for this provi
96
96
  are in ``airflow.providers.teradata`` python package.
97
97
 
98
98
  You can find package information and changelog for the provider
99
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-teradata/2.2.0/>`_.
99
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-teradata/2.3.0/>`_.
100
100
 
101
101
  Installation
102
102
  ------------
@@ -141,4 +141,4 @@ Dependent package
141
141
  ====================================================================================================================== ===================
142
142
 
143
143
  The changelog for the provider package can be found in the
144
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-teradata/2.2.0/changelog.html>`_.
144
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-teradata/2.3.0/changelog.html>`_.
@@ -42,7 +42,7 @@
42
42
 
43
43
  Package ``apache-airflow-providers-teradata``
44
44
 
45
- Release: ``2.2.0.rc1``
45
+ Release: ``2.3.0.rc1``
46
46
 
47
47
 
48
48
  `Teradata <https://www.teradata.com/>`__
@@ -55,7 +55,7 @@ This is a provider package for ``teradata`` provider. All classes for this provi
55
55
  are in ``airflow.providers.teradata`` python package.
56
56
 
57
57
  You can find package information and changelog for the provider
58
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-teradata/2.2.0/>`_.
58
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-teradata/2.3.0/>`_.
59
59
 
60
60
  Installation
61
61
  ------------
@@ -100,4 +100,4 @@ Dependent package
100
100
  ====================================================================================================================== ===================
101
101
 
102
102
  The changelog for the provider package can be found in the
103
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-teradata/2.2.0/changelog.html>`_.
103
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-teradata/2.3.0/changelog.html>`_.
@@ -215,7 +215,7 @@ Third party Apache 2.0 licenses
215
215
 
216
216
  The following components are provided under the Apache 2.0 License.
217
217
  See project link for details. The text of each license is also included
218
- at licenses/LICENSE-[project].txt.
218
+ at 3rd-party-licenses/LICENSE-[project].txt.
219
219
 
220
220
  (ALv2 License) hue v4.3.0 (https://github.com/cloudera/hue/)
221
221
  (ALv2 License) jqclock v2.3.0 (https://github.com/JohnRDOrazio/jQuery-Clock-Plugin)
@@ -227,7 +227,7 @@ MIT licenses
227
227
  ========================================================================
228
228
 
229
229
  The following components are provided under the MIT License. See project link for details.
230
- The text of each license is also included at licenses/LICENSE-[project].txt.
230
+ The text of each license is also included at 3rd-party-licenses/LICENSE-[project].txt.
231
231
 
232
232
  (MIT License) jquery v3.5.1 (https://jquery.org/license/)
233
233
  (MIT License) dagre-d3 v0.6.4 (https://github.com/cpettitt/dagre-d3)
@@ -243,11 +243,11 @@ The text of each license is also included at licenses/LICENSE-[project].txt.
243
243
  BSD 3-Clause licenses
244
244
  ========================================================================
245
245
  The following components are provided under the BSD 3-Clause license. See project links for details.
246
- The text of each license is also included at licenses/LICENSE-[project].txt.
246
+ The text of each license is also included at 3rd-party-licenses/LICENSE-[project].txt.
247
247
 
248
248
  (BSD 3 License) d3 v5.16.0 (https://d3js.org)
249
249
  (BSD 3 License) d3-shape v2.1.0 (https://github.com/d3/d3-shape)
250
250
  (BSD 3 License) cgroupspy 0.2.1 (https://github.com/cloudsigma/cgroupspy)
251
251
 
252
252
  ========================================================================
253
- See licenses/LICENSES-ui.txt for packages used in `/airflow/www`
253
+ See 3rd-party-licenses/LICENSES-ui.txt for packages used in `/airflow/www`
@@ -29,7 +29,7 @@ from airflow import __version__ as airflow_version
29
29
 
30
30
  __all__ = ["__version__"]
31
31
 
32
- __version__ = "2.2.0"
32
+ __version__ = "2.3.0"
33
33
 
34
34
  if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
35
35
  "2.7.0"
@@ -28,8 +28,8 @@ def get_provider_info():
28
28
  "name": "Teradata",
29
29
  "description": "`Teradata <https://www.teradata.com/>`__\n",
30
30
  "state": "ready",
31
- "source-date-epoch": 1717051506,
32
- "versions": ["2.2.0", "2.1.1", "2.1.0", "2.0.0"],
31
+ "source-date-epoch": 1719054575,
32
+ "versions": ["2.3.0", "2.2.0", "2.1.1", "2.1.0", "2.0.0"],
33
33
  "dependencies": [
34
34
  "apache-airflow>=2.7.0",
35
35
  "apache-airflow-providers-common-sql>=1.3.1",
@@ -31,7 +31,7 @@ class TeradataOperator(SQLExecuteQueryOperator):
31
31
  """
32
32
  General Teradata Operator to execute queries on Teradata Database.
33
33
 
34
- Executes sql statements in the Teradata SQL Database using teradatasql jdbc driver
34
+ Executes sql statements in the Teradata SQL Database using Teradata Python SQL Driver
35
35
 
36
36
  .. seealso::
37
37
  For more information on how to use this operator, take a look at the guide:
@@ -48,10 +48,17 @@ class AzureBlobStorageToTeradataOperator(BaseOperator):
48
48
  The URI format is `/az/YOUR-STORAGE-ACCOUNT.blob.core.windows.net/YOUR-CONTAINER/YOUR-BLOB-LOCATION`.
49
49
  Refer to
50
50
  https://docs.teradata.com/search/documents?query=native+object+store&sort=last_update&virtual-field=title_only&content-lang=en-US
51
+ :param public_bucket: Specifies whether the provided blob container is public. If the blob container is public,
52
+ it means that anyone can access the objects within it via a URL without requiring authentication.
53
+ If the bucket is private and authentication is not provided, the operator will throw an exception.
51
54
  :param azure_conn_id: The Airflow WASB connection used for azure blob credentials.
52
55
  :param teradata_table: The name of the teradata table to which the data is transferred.(templated)
53
56
  :param teradata_conn_id: The connection ID used to connect to Teradata
54
57
  :ref:`Teradata connection <howto/connection:Teradata>`
58
+ :param teradata_authorization_name: The name of Teradata Authorization Database Object,
59
+ is used to control who can access an Azure Blob object store.
60
+ Refer to
61
+ https://docs.teradata.com/r/Enterprise_IntelliFlex_VMware/Teradata-VantageTM-Native-Object-Store-Getting-Started-Guide-17.20/Setting-Up-Access/Controlling-Foreign-Table-Access-with-an-AUTHORIZATION-Object
55
62
 
56
63
  Note that ``blob_source_key`` and ``teradata_table`` are
57
64
  templated, so you can use variables in them if you wish.
@@ -64,37 +71,48 @@ class AzureBlobStorageToTeradataOperator(BaseOperator):
64
71
  self,
65
72
  *,
66
73
  blob_source_key: str,
74
+ public_bucket: bool = False,
67
75
  azure_conn_id: str = "azure_default",
68
76
  teradata_table: str,
69
77
  teradata_conn_id: str = "teradata_default",
78
+ teradata_authorization_name: str = "",
70
79
  **kwargs,
71
80
  ) -> None:
72
81
  super().__init__(**kwargs)
73
82
  self.blob_source_key = blob_source_key
83
+ self.public_bucket = public_bucket
74
84
  self.azure_conn_id = azure_conn_id
75
85
  self.teradata_table = teradata_table
76
86
  self.teradata_conn_id = teradata_conn_id
87
+ self.teradata_authorization_name = teradata_authorization_name
77
88
 
78
89
  def execute(self, context: Context) -> None:
79
90
  self.log.info(
80
91
  "transferring data from %s to teradata table %s...", self.blob_source_key, self.teradata_table
81
92
  )
82
- azure_hook = WasbHook(wasb_conn_id=self.azure_conn_id)
83
- conn = azure_hook.get_connection(self.azure_conn_id)
84
- # Obtaining the Azure client ID and Azure secret in order to access a specified Blob container
85
- access_id = conn.login if conn.login is not None else ""
86
- access_secret = conn.password if conn.password is not None else ""
87
93
  teradata_hook = TeradataHook(teradata_conn_id=self.teradata_conn_id)
94
+ credentials_part = "ACCESS_ID= '' ACCESS_KEY= ''"
95
+ if not self.public_bucket:
96
+ # Accessing data directly from the Azure Blob Storage and creating permanent table inside the
97
+ # database
98
+ if self.teradata_authorization_name:
99
+ credentials_part = f"AUTHORIZATION={self.teradata_authorization_name}"
100
+ else:
101
+ # Obtaining the Azure client ID and Azure secret in order to access a specified Blob container
102
+ azure_hook = WasbHook(wasb_conn_id=self.azure_conn_id)
103
+ conn = azure_hook.get_connection(self.azure_conn_id)
104
+ access_id = conn.login
105
+ access_secret = conn.password
106
+ credentials_part = f"ACCESS_ID= '{access_id}' ACCESS_KEY= '{access_secret}'"
88
107
  sql = dedent(f"""
89
- CREATE MULTISET TABLE {self.teradata_table} AS
90
- (
91
- SELECT * FROM (
92
- LOCATION = '{self.blob_source_key}'
93
- ACCESS_ID= '{access_id}'
94
- ACCESS_KEY= '{access_secret}'
95
- ) AS d
96
- ) WITH DATA
97
- """).rstrip()
108
+ CREATE MULTISET TABLE {self.teradata_table} AS
109
+ (
110
+ SELECT * FROM (
111
+ LOCATION = '{self.blob_source_key}'
112
+ {credentials_part}
113
+ ) AS d
114
+ ) WITH DATA
115
+ """).rstrip()
98
116
  try:
99
117
  teradata_hook.run(sql, True)
100
118
  except Exception as ex:
@@ -53,6 +53,10 @@ class S3ToTeradataOperator(BaseOperator):
53
53
  :param aws_conn_id: The Airflow AWS connection used for AWS credentials.
54
54
  :param teradata_conn_id: The connection ID used to connect to Teradata
55
55
  :ref:`Teradata connection <howto/connection:Teradata>`.
56
+ :param teradata_authorization_name: The name of Teradata Authorization Database Object,
57
+ is used to control who can access an S3 object store.
58
+ Refer to
59
+ https://docs.teradata.com/r/Enterprise_IntelliFlex_VMware/Teradata-VantageTM-Native-Object-Store-Getting-Started-Guide-17.20/Setting-Up-Access/Controlling-Foreign-Table-Access-with-an-AUTHORIZATION-Object
56
60
 
57
61
  Note that ``s3_source_key`` and ``teradata_table`` are
58
62
  templated, so you can use variables in them if you wish.
@@ -69,6 +73,7 @@ class S3ToTeradataOperator(BaseOperator):
69
73
  teradata_table: str,
70
74
  aws_conn_id: str = "aws_default",
71
75
  teradata_conn_id: str = "teradata_default",
76
+ teradata_authorization_name: str = "",
72
77
  **kwargs,
73
78
  ) -> None:
74
79
  super().__init__(**kwargs)
@@ -77,6 +82,7 @@ class S3ToTeradataOperator(BaseOperator):
77
82
  self.teradata_table = teradata_table
78
83
  self.aws_conn_id = aws_conn_id
79
84
  self.teradata_conn_id = teradata_conn_id
85
+ self.teradata_authorization_name = teradata_authorization_name
80
86
 
81
87
  def execute(self, context: Context) -> None:
82
88
  self.log.info(
@@ -84,20 +90,26 @@ class S3ToTeradataOperator(BaseOperator):
84
90
  )
85
91
 
86
92
  s3_hook = S3Hook(aws_conn_id=self.aws_conn_id)
87
- access_key = ""
88
- access_secret = ""
89
- if not self.public_bucket:
90
- credentials = s3_hook.get_credentials()
91
- access_key = credentials.access_key
92
- access_secret = credentials.secret_key
93
93
  teradata_hook = TeradataHook(teradata_conn_id=self.teradata_conn_id)
94
+ credentials_part = "ACCESS_ID= '' ACCESS_KEY= ''"
95
+ if not self.public_bucket:
96
+ # Accessing data directly from the S3 bucket and creating permanent table inside the database
97
+ if self.teradata_authorization_name:
98
+ credentials_part = f"AUTHORIZATION={self.teradata_authorization_name}"
99
+ else:
100
+ credentials = s3_hook.get_credentials()
101
+ access_key = credentials.access_key
102
+ access_secret = credentials.secret_key
103
+ credentials_part = f"ACCESS_ID= '{access_key}' ACCESS_KEY= '{access_secret}'"
104
+ token = credentials.token
105
+ if token:
106
+ credentials_part = credentials_part + f" SESSION_TOKEN = '{token}'"
94
107
  sql = dedent(f"""
95
108
  CREATE MULTISET TABLE {self.teradata_table} AS
96
109
  (
97
110
  SELECT * FROM (
98
111
  LOCATION = '{self.s3_source_key}'
99
- ACCESS_ID= '{access_key}'
100
- ACCESS_KEY= '{access_secret}'
112
+ {credentials_part}
101
113
  ) AS d
102
114
  ) WITH DATA
103
115
  """).rstrip()
@@ -28,7 +28,7 @@ build-backend = "flit_core.buildapi"
28
28
 
29
29
  [project]
30
30
  name = "apache-airflow-providers-teradata"
31
- version = "2.2.0.rc1"
31
+ version = "2.3.0.rc1"
32
32
  description = "Provider package apache-airflow-providers-teradata for Apache Airflow"
33
33
  readme = "README.rst"
34
34
  authors = [
@@ -63,8 +63,8 @@ dependencies = [
63
63
  ]
64
64
 
65
65
  [project.urls]
66
- "Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-teradata/2.2.0"
67
- "Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-teradata/2.2.0/changelog.html"
66
+ "Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-teradata/2.3.0"
67
+ "Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-teradata/2.3.0/changelog.html"
68
68
  "Bug Tracker" = "https://github.com/apache/airflow/issues"
69
69
  "Source Code" = "https://github.com/apache/airflow"
70
70
  "Slack Chat" = "https://s.apache.org/airflow-slack"