josh-fell commented on a change in pull request #19873: URL: https://github.com/apache/airflow/pull/19873#discussion_r758496565
########## File path: docs/apache-airflow-providers-google/operators/transfer/mssql_to_gcs.rst ########## @@ -0,0 +1,51 @@ + .. 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. + +Microsoft SQL Server To Google Cloud Storage Operator +====================================== Review comment: ```suggestion Microsoft SQL Server To Google Cloud Storage Operator ===================================================== ``` The underline needs to match the length of the line it's underlining in Sphinx. ########## File path: docs/apache-airflow-providers-google/operators/transfer/mssql_to_gcs.rst ########## @@ -0,0 +1,51 @@ + .. 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. + +Microsoft SQL Server To Google Cloud Storage Operator +====================================== +The `Google Cloud Storage <https://cloud.google.com/storage/>`__ (GCS) service is +used to store large data from various applications. This page shows how to copy +data from Microsoft SQL Server to GCS. + +Prerequisite Tasks +^^^^^^^^^^^^^^^^^^ + +.. include::/howto/operator/google/_partials/prerequisite_tasks.rst + +.. _howto/operator:MSSQLToGCSOperator: + +MSSQLToGCSOperator +~~~~~~~~~~~~~~~~~~ + +:class:`~airflow.providers.google.cloud.transfers.mssql_to_gcs.MSSQLToGCSOperator` allows you to upload +data from Microsoft SQL Server database to GCS. + +Below is an example of using this operator to upload data to GCS. + +.. exampleinclude:: /../../airflow/providers/google/cloud/example_dags/example_mssql_to_gcs.py + :language: python + :dedent: 0 Review comment: This isn't needed. The default value here is 0. ########## File path: airflow/providers/google/cloud/example_dags/example_mssql_to_gcs.py ########## @@ -0,0 +1,43 @@ +# 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. +import os + +from airflow import models +from airflow.providers.google.cloud.transfers.mssql_to_gcs import MSSQLToGCSOperator +from airflow.utils import dates + +GCS_BUCKET = os.environ.get("GCP_GCS_BUCKET", "example-airflow") +FILENAME = 'test_file' + +SQL_QUERY = "USE airflow SELECT * FROM Country;" + +with models.DAG( + 'example_mssql_to_gcs', + default_args=dict(start_date=dates.days_ago(1)), Review comment: Yes and we've been adding `catchup=False` in all example DAGs to ward off DagRun headaches for new users. @uranusjr I could be wrong here but having `start_date=None` would throw an exception that the `start_date` parameter is missing right? -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
