Skip to content

Commit

Permalink
Migrate Salesforce example DAGs to new design apache#22463 (apache#24127
Browse files Browse the repository at this point in the history
)
  • Loading branch information
chethanuk authored Jun 3, 2022
1 parent 23f367a commit fdf5185
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
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)

0 comments on commit fdf5185

Please sign in to comment.