Taragolis commented on code in PR #34907: URL: https://github.com/apache/airflow/pull/34907#discussion_r1357983602
########## tests/system/providers/microsoft/psrp/example_psrp.py: ########## @@ -0,0 +1,79 @@ +# +# 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. +""" +This is an example dag for using the PsrpOperator. +""" +from __future__ import annotations + +# -------------------------------------------------------------------------------- +# Load The Dependencies +# -------------------------------------------------------------------------------- +from datetime import datetime, timedelta + +from airflow import DAG + +# -------------------------------------------------------------------------------- +# The purpose of this is to give you a sample of a real world example DAG! +# -------------------------------------------------------------------------------- + + +try: + from airflow.operators.empty import EmptyOperator +except ModuleNotFoundError: + from airflow.operators.dummy import DummyOperator as EmptyOperator # type: ignore + +from airflow.providers.microsoft.psrp.operators.psrp import PsrpOperator + +DAG_ID = "PSRP_EXAMPLE_DAG" + +default_args = {"psrp_conn_id": "the_conn_id"} + +with DAG( + dag_id=DAG_ID, + schedule="0 0 * * *", + start_date=datetime(2203, 10, 1), Review Comment: ```suggestion start_date=datetime(2023, 10, 1), ``` ########## tests/system/providers/microsoft/psrp/example_psrp.py: ########## @@ -0,0 +1,79 @@ +# +# 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. +""" +This is an example dag for using the PsrpOperator. +""" +from __future__ import annotations + +# -------------------------------------------------------------------------------- +# Load The Dependencies +# -------------------------------------------------------------------------------- +from datetime import datetime, timedelta + +from airflow import DAG + +# -------------------------------------------------------------------------------- +# The purpose of this is to give you a sample of a real world example DAG! +# -------------------------------------------------------------------------------- + + +try: + from airflow.operators.empty import EmptyOperator +except ModuleNotFoundError: + from airflow.operators.dummy import DummyOperator as EmptyOperator # type: ignore Review Comment: I'm not sure that we should fallback to `DummyOperator` because `EmptyOperator` introduced into the airflow 2.3, and next release of provider would have requirement min Airflow 2.5 Tis may not apply to examples/system tests so let's wait and see what the other says -- 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]
