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

Migrate Salesforce example DAGs to new design #22463 #24127

Merged
merged 1 commit into from
Jun 3, 2022
Merged
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
16 changes: 0 additions & 16 deletions airflow/providers/salesforce/example_dags/__init__.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ You can also use this library to call custom Apex methods:
This would call the endpoint ``https://<instance>.salesforce.com/services/apexrest/User/Activity`` with ``payload`` as
the body content encoded with ``json.dumps``

.. exampleinclude:: /../../airflow/providers/salesforce/example_dags/example_salesforce_apex_rest.py
.. exampleinclude:: /../../tests/system/providers/salesforce/example_salesforce_apex_rest.py
:language: python
:start-after: [START howto_salesforce_apex_rest_operator]
:end-before: [END howto_salesforce_apex_rest_operator]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
import os
from datetime import datetime

from airflow import DAG
from airflow.providers.salesforce.operators.salesforce_apex_rest import SalesforceApexRestOperator

ENV_ID = os.environ.get("SYSTEM_TESTS_ENV_ID")
DAG_ID = "example_gcs_to_trino"


with DAG(
dag_id="salesforce_apex_rest_operator_dag",
schedule_interval=None,
Expand All @@ -33,3 +38,9 @@
task_id="apex_task", method='POST', endpoint='User/Activity', payload=payload
)
# [END howto_salesforce_apex_rest_operator]


from tests.system.utils import get_test_run # noqa: E402

# Needed to run the example DAG with pytest (see: tests/system/README.md#run_via_pytest)
test_run = get_test_run(dag)