Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sql Check Provider Updates #24790

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/airflow_providers_bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ body:
- celery
- cloudant
- cncf-kubernetes
- core-sql
- common-sql
- databricks
- datadog
- dbt-cloud
Expand Down
18 changes: 9 additions & 9 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -620,15 +620,15 @@ This is the full list of those extras:
airbyte, alibaba, all, all_dbs, amazon, apache.atlas, apache.beam, apache.cassandra, apache.drill,
apache.druid, apache.hdfs, apache.hive, apache.kylin, apache.livy, apache.pig, apache.pinot,
apache.spark, apache.sqoop, apache.webhdfs, arangodb, asana, async, atlas, aws, azure, cassandra,
celery, cgroups, cloudant, cncf.kubernetes, core.sql, crypto, dask, databricks, datadog, dbt.cloud,
deprecated_api, devel, devel_all, devel_ci, devel_hadoop, dingding, discord, doc, docker, druid,
elasticsearch, exasol, facebook, ftp, gcp, gcp_api, github, github_enterprise, google, google_auth,
grpc, hashicorp, hdfs, hive, http, imap, influxdb, jdbc, jenkins, jira, kerberos, kubernetes, ldap,
leveldb, microsoft.azure, microsoft.mssql, microsoft.psrp, microsoft.winrm, mongo, mssql, mysql,
neo4j, odbc, openfaas, opsgenie, oracle, pagerduty, pandas, papermill, password, pinot, plexus,
postgres, presto, qds, qubole, rabbitmq, redis, s3, salesforce, samba, segment, sendgrid, sentry,
sftp, singularity, slack, snowflake, spark, sqlite, ssh, statsd, tableau, telegram, trino, vertica,
virtualenv, webhdfs, winrm, yandex, zendesk
celery, cgroups, cloudant, cncf.kubernetes, common.sql, crypto, dask, databricks, datadog,
dbt.cloud, deprecated_api, devel, devel_all, devel_ci, devel_hadoop, dingding, discord, doc, docker,
druid, elasticsearch, exasol, facebook, ftp, gcp, gcp_api, github, github_enterprise, google,
google_auth, grpc, hashicorp, hdfs, hive, http, imap, influxdb, jdbc, jenkins, jira, kerberos,
kubernetes, ldap, leveldb, microsoft.azure, microsoft.mssql, microsoft.psrp, microsoft.winrm, mongo,
mssql, mysql, neo4j, odbc, openfaas, opsgenie, oracle, pagerduty, pandas, papermill, password,
pinot, plexus, postgres, presto, qds, qubole, rabbitmq, redis, s3, salesforce, samba, segment,
sendgrid, sentry, sftp, singularity, slack, snowflake, spark, sqlite, ssh, statsd, tableau,
telegram, trino, vertica, virtualenv, webhdfs, winrm, yandex, zendesk
.. END EXTRAS HERE

Provider packages
Expand Down
18 changes: 9 additions & 9 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ The list of available extras:
airbyte, alibaba, all, all_dbs, amazon, apache.atlas, apache.beam, apache.cassandra, apache.drill,
apache.druid, apache.hdfs, apache.hive, apache.kylin, apache.livy, apache.pig, apache.pinot,
apache.spark, apache.sqoop, apache.webhdfs, arangodb, asana, async, atlas, aws, azure, cassandra,
celery, cgroups, cloudant, cncf.kubernetes, core.sql, crypto, dask, databricks, datadog, dbt.cloud,
deprecated_api, devel, devel_all, devel_ci, devel_hadoop, dingding, discord, doc, docker, druid,
elasticsearch, exasol, facebook, ftp, gcp, gcp_api, github, github_enterprise, google, google_auth,
grpc, hashicorp, hdfs, hive, http, imap, influxdb, jdbc, jenkins, jira, kerberos, kubernetes, ldap,
leveldb, microsoft.azure, microsoft.mssql, microsoft.psrp, microsoft.winrm, mongo, mssql, mysql,
neo4j, odbc, openfaas, opsgenie, oracle, pagerduty, pandas, papermill, password, pinot, plexus,
postgres, presto, qds, qubole, rabbitmq, redis, s3, salesforce, samba, segment, sendgrid, sentry,
sftp, singularity, slack, snowflake, spark, sqlite, ssh, statsd, tableau, telegram, trino, vertica,
virtualenv, webhdfs, winrm, yandex, zendesk
celery, cgroups, cloudant, cncf.kubernetes, common.sql, crypto, dask, databricks, datadog,
dbt.cloud, deprecated_api, devel, devel_all, devel_ci, devel_hadoop, dingding, discord, doc, docker,
druid, elasticsearch, exasol, facebook, ftp, gcp, gcp_api, github, github_enterprise, google,
google_auth, grpc, hashicorp, hdfs, hive, http, imap, influxdb, jdbc, jenkins, jira, kerberos,
kubernetes, ldap, leveldb, microsoft.azure, microsoft.mssql, microsoft.psrp, microsoft.winrm, mongo,
mssql, mysql, neo4j, odbc, openfaas, opsgenie, oracle, pagerduty, pandas, papermill, password,
pinot, plexus, postgres, presto, qds, qubole, rabbitmq, redis, s3, salesforce, samba, segment,
sendgrid, sentry, sftp, singularity, slack, snowflake, spark, sqlite, ssh, statsd, tableau,
telegram, trino, vertica, virtualenv, webhdfs, winrm, yandex, zendesk
# END EXTRAS HERE

# For installing Airflow in development environments - see CONTRIBUTING.rst
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# specific language governing permissions and limitations
# under the License.
from airflow import DAG
from airflow.providers.core.sql.operators.sql import SQLColumnCheckOperator, SQLTableCheckOperator
from airflow.providers.common.sql.operators.sql import SQLColumnCheckOperator, SQLTableCheckOperator
from airflow.utils.dates import datetime

AIRFLOW_DB_METADATA_TABLE = "ab_role"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def execute(self, context=None):
if not records:
raise AirflowException(f"The following query returned zero rows: {self.sql}")

self.log.info(f"Record: {records}")
self.log.info("Record: %s", records)

for idx, result in enumerate(records):
tolerance = self.column_mapping[column][checks[idx]].get("tolerance")
Expand Down Expand Up @@ -298,7 +298,7 @@ def execute(self, context=None):
if not records:
raise AirflowException(f"The following query returned zero rows: {self.sql}")

self.log.info(f"Record: {records}")
self.log.info("Record: %s", records)

for check in self.checks.keys():
for result in records:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
# under the License.

---
package-name: apache-airflow-providers-core-sql
name: Core SQL
package-name: apache-airflow-providers-common-sql
name: Common SQL
description: |
`Core SQL Provider <https://en.wikipedia.org/wiki/SQL>`__
`Common SQL Provider <https://en.wikipedia.org/wiki/SQL>`__

versions:
- 1.0.0
Expand All @@ -28,14 +28,14 @@ dependencies:
- apache-airflow>=2.2.0

integrations:
- integration-name: Core SQL
- integration-name: Common SQL
external-doc-url: https://en.wikipedia.org/wiki/SQL
how-to-guide:
- /docs/apache-airflow-providers-core-sql/operators.rst
logo: /integration-logos/core/sql/sql.png
- /docs/apache-airflow-providers-common-sql/operators.rst
logo: /integration-logos/common/sql/sql.png
tags: [software]

operators:
- integration-name: Core SQL
- integration-name: Common SQL
python-modules:
- airflow.providers.core.sql.operators.sql
- airflow.providers.common.sql.operators.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
specific language governing permissions and limitations
under the License.

Package apache-airflow-providers-core-sql
Package apache-airflow-providers-common-sql
------------------------------------------

`Core SQL Provider <https://en.wikipedia.org/wiki/SQL>`__
`Common SQL Provider <https://en.wikipedia.org/wiki/SQL>`__


This is detailed commit list of changes for versions provider package: ``core.sql``.
This is detailed commit list of changes for versions provider package: ``common.sql``.
For high-level changelog, see :doc:`package information including changelog <index>`.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
specific language governing permissions and limitations
under the License.

``apache-airflow-providers-core-sql``
``apache-airflow-providers-common-sql``
============================================

Content
Expand All @@ -32,14 +32,14 @@ Content
:maxdepth: 1
:caption: References

Python API <_api/airflow/providers/core/sql/index>
Python API <_api/airflow/providers/common/sql/index>

.. toctree::
:maxdepth: 1
:caption: Resources

Example DAGs <https://github.com/apache/airflow/tree/main/airflow/providers/core/sql/example_dags>
PyPI Repository <https://pypi.org/project/apache-airflow-providers-core-sql/>
Example DAGs <https://github.com/apache/airflow/tree/main/airflow/providers/common/sql/example_dags>
PyPI Repository <https://pypi.org/project/apache-airflow-providers-common-sql/>
Installing from sources <installing-providers-from-sources>

.. THE REMAINDER OF THE FILE IS AUTOMATICALLY GENERATED. IT WILL BE OVERWRITTEN AT RELEASE TIME!
Expand All @@ -50,5 +50,5 @@ Content
Detailed list of commits <commits>


Package apache-airflow-providers-core-sql
Package apache-airflow-providers-common-sql
------------------------------------------------------
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ column- and table-level data quality checks.
Check SQL Table Columns
~~~~~~~~~~~~~~~~~~~~~~~

Use the :class:`~airflow.providers.core.sql.operators.sql.SQLColumnCheckOperator` to run data quality
Use the :class:`~airflow.providers.common.sql.operators.sql.SQLColumnCheckOperator` to run data quality
checks against columns of a given table. As well as a connection ID and table, a column_mapping
describing the relationship between columns and tests to run must be supplied. An example column
mapping is a set of three nested dictionaries and looks like:
Expand Down Expand Up @@ -71,7 +71,7 @@ be out of bounds but still considered successful.

The below example demonstrates how to instantiate the SQLColumnCheckOperator task.

.. exampleinclude:: /../../airflow/providers/core/sql/example_dags/example_sql_column_table_check.py
.. exampleinclude:: /../../airflow/providers/common/sql/example_dags/example_sql_column_table_check.py
:language: python
:dedent: 4
:start-after: [START howto_operator_sql_column_check]
Expand All @@ -82,7 +82,7 @@ The below example demonstrates how to instantiate the SQLColumnCheckOperator tas
Check SQL Table Values
~~~~~~~~~~~~~~~~~~~~~~~

Use the :class:`~airflow.providers.core.sql.operators.sql.SQLTableCheckOperator` to run data quality
Use the :class:`~airflow.providers.common.sql.operators.sql.SQLTableCheckOperator` to run data quality
checks against a given table. As well as a connection ID and table, a checks dictionary
describing the relationship between the table and tests to run must be supplied. An example
checks argument is a set of two nested dictionaries and looks like:
Expand All @@ -105,7 +105,7 @@ airflow.operators.sql.parse_boolean).

The below example demonstrates how to instantiate the SQLTableCheckOperator task.

.. exampleinclude:: /../../airflow/providers/core/sql/example_dags/example_sql_column_table_check.py
.. exampleinclude:: /../../airflow/providers/common/sql/example_dags/example_sql_column_table_check.py
:language: python
:dedent: 4
:start-after: [START howto_operator_sql_table_check]
Expand Down
2 changes: 1 addition & 1 deletion docs/apache-airflow/extra-packages-ref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ These are extras that provide support for integration with external systems via
+---------------------+-----------------------------------------------------+--------------------------------------+--------------+
| extra | install command | enables | Preinstalled |
+=====================+=====================================================+======================================+==============+
| core.sql | ``pip install 'apache-airflow[core.sql]'`` | Core SQL Operators | |
| common.sql | ``pip install 'apache-airflow[common.sql]'`` | Common SQL Operators | |
+---------------------+-----------------------------------------------------+--------------------------------------+--------------+
| ftp | ``pip install 'apache-airflow[ftp]'`` | FTP hooks and operators | * |
+---------------------+-----------------------------------------------------+--------------------------------------+--------------+
Expand Down
2 changes: 1 addition & 1 deletion generated/provider_dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
],
"cross-providers-deps": []
},
"core.sql": {
"common.sql": {
"deps": [
"apache-airflow>=2.2.0"
],
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ def add_all_deprecated_provider_packages() -> None:
'apache.pinot',
'arangodb',
'cloudant',
'common.sql',
'databricks',
'exasol',
'influxdb',
Expand Down
File renamed without changes.