You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "alliasgher (via GitHub)" <gi...@apache.org> on 2026/04/12 23:46:09 UTC

[PR] docs(snowflake): add data quality operator examples and documentation [airflow]

alliasgher opened a new pull request, #65112:
URL: https://github.com/apache/airflow/pull/65112

   ## Summary
   
   - Add example DAG (`example_snowflake_data_quality.py`) demonstrating `SnowflakeCheckOperator`, `SnowflakeValueCheckOperator`, and `SnowflakeIntervalCheckOperator`
   - Update `snowflake.rst` operator guide with usage sections and code snippets for all three data quality operators
   
   ## Motivation
   
   The Snowflake provider includes three data quality check operators (`SnowflakeCheckOperator`, `SnowflakeValueCheckOperator`, `SnowflakeIntervalCheckOperator`), but the current documentation only covers `SQLExecuteQueryOperator` and `SnowflakeSqlApiOperator`. This makes the data quality operators harder to discover and use.
   
   Closes #65098
   
   ## Changes
   
   ### New file: `providers/snowflake/tests/system/snowflake/example_snowflake_data_quality.py`
   - Creates a sample table with data for both the current date and 7 days ago
   - Demonstrates `SnowflakeCheckOperator` — verifies table is non-empty
   - Demonstrates `SnowflakeValueCheckOperator` — asserts exact row count with tolerance
   - Demonstrates `SnowflakeIntervalCheckOperator` — compares `COUNT(*)` and `SUM(amount)` between current and prior period
   - Follows the existing pattern from `example_snowflake.py` (setup → checks → teardown)
   
   ### Updated file: `providers/snowflake/docs/operators/snowflake.rst`
   - Added `SnowflakeCheckOperator` section with description and example snippet
   - Added `SnowflakeValueCheckOperator` section with description and example snippet
   - Added `SnowflakeIntervalCheckOperator` section with description and example snippet
   - Each section includes cross-reference anchors (`:ref:` targets) for linking from other docs
   
   ^ Add documentation between the existing `SQLExecuteQueryOperator` and `SnowflakeSqlApiOperator` sections.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs(snowflake): add data quality operator examples and documentation [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #65112: docs(snowflake): add data quality operator examples and documentation
URL: https://github.com/apache/airflow/pull/65112


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs(snowflake): add data quality operator examples and documentation [airflow]

Posted by "jroachgolf84 (via GitHub)" <gi...@apache.org>.
jroachgolf84 commented on code in PR #65112:
URL: https://github.com/apache/airflow/pull/65112#discussion_r3073246438


##########
providers/snowflake/tests/system/snowflake/example_snowflake_data_quality.py:
##########
@@ -0,0 +1,132 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""
+Example use of Snowflake data quality check operators.
+
+Demonstrates SnowflakeCheckOperator, SnowflakeValueCheckOperator,
+and SnowflakeIntervalCheckOperator for common data quality use cases.
+"""
+
+from __future__ import annotations
+
+import os
+from datetime import datetime
+
+from airflow import DAG
+from airflow.providers.common.sql.operators.sql import SQLExecuteQueryOperator
+from airflow.providers.snowflake.operators.snowflake import (
+    SnowflakeCheckOperator,
+    SnowflakeIntervalCheckOperator,
+    SnowflakeValueCheckOperator,
+)
+
+SNOWFLAKE_CONN_ID = "my_snowflake_conn"

Review Comment:
   Not to be overly pedantic, by I'd add in the explicit `snowflake_conn_id` parameter in each Operator. That way, folks know this is a field that they're going to need. If it's in `default_args`, they won't see it in the docs.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs(snowflake): add data quality operator examples and documentation [airflow]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #65112:
URL: https://github.com/apache/airflow/pull/65112#issuecomment-4233002900

   Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our [Contributors' Guide](https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
   Here are some useful points:
   - Pay attention to the quality of your code (ruff, mypy and type annotations). Our [prek-hooks]( https://github.com/apache/airflow/blob/main/contributing-docs/08_static_code_checks.rst#prerequisites-for-prek-hooks) will help you with that.
   - In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/main/airflow-core/docs/howto/custom-operator.rst) Consider adding an example DAG that shows how users should use it.
   - Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/dev/breeze/doc/README.rst) for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
   - Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
   - Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
   - Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#coding-style-and-best-practices).
   - Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
   Apache Airflow is a community-driven project and together we are making it better 🚀.
   In case of doubts contact the developers at:
   Mailing List: dev@airflow.apache.org
   Slack: https://s.apache.org/airflow-slack
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs(snowflake): add data quality operator examples and documentation [airflow]

Posted by "alliasgher (via GitHub)" <gi...@apache.org>.
alliasgher commented on code in PR #65112:
URL: https://github.com/apache/airflow/pull/65112#discussion_r3073333189


##########
providers/snowflake/tests/system/snowflake/example_snowflake_data_quality.py:
##########
@@ -0,0 +1,132 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""
+Example use of Snowflake data quality check operators.
+
+Demonstrates SnowflakeCheckOperator, SnowflakeValueCheckOperator,
+and SnowflakeIntervalCheckOperator for common data quality use cases.
+"""
+
+from __future__ import annotations
+
+import os
+from datetime import datetime
+
+from airflow import DAG
+from airflow.providers.common.sql.operators.sql import SQLExecuteQueryOperator
+from airflow.providers.snowflake.operators.snowflake import (
+    SnowflakeCheckOperator,
+    SnowflakeIntervalCheckOperator,
+    SnowflakeValueCheckOperator,
+)
+
+SNOWFLAKE_CONN_ID = "my_snowflake_conn"

Review Comment:
   Done, removed from `default_args` and added `snowflake_conn_id` explicitly to each operator.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs(snowflake): add data quality operator examples and documentation [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #65112:
URL: https://github.com/apache/airflow/pull/65112#issuecomment-5186139114

   This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs(snowflake): add data quality operator examples and documentation [airflow]

Posted by "alliasgher (via GitHub)" <gi...@apache.org>.
alliasgher commented on PR #65112:
URL: https://github.com/apache/airflow/pull/65112#issuecomment-5247544672

   /reopen 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org