Skip to content
Draft
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
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ dependencies = [
"pypdf>=5.0.0",
"python-dateutil>=2.9.0.post0",
"scikit-learn>=1.4.0",
<<<<<<< HEAD
"simple-salesforce>=1.12.6",
=======
"sqlalchemy>=2.0.42",
>>>>>>> main
"tableauserverclient>=0.25",
"tenacity>=8.2.3",
"urllib3>=2.6.3",
Expand Down
12 changes: 12 additions & 0 deletions src/teamster/code_locations/kipptaf/_dlt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
from teamster.code_locations.kipptaf._dlt.illuminate.assets import (

Check failure on line 1 in src/teamster/code_locations/kipptaf/_dlt/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

isort

Incorrect formatting, autoformat by running 'trunk fmt'
assets as illuminate_assets,
)
from teamster.code_locations.kipptaf._dlt.illuminate.schedules import schedules
<<<<<<< HEAD

Check failure on line 5 in src/teamster/code_locations/kipptaf/_dlt/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 5 in src/teamster/code_locations/kipptaf/_dlt/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 5 in src/teamster/code_locations/kipptaf/_dlt/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 5 in src/teamster/code_locations/kipptaf/_dlt/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement
from teamster.code_locations.kipptaf._dlt.salesforce.assets import (
assets as salesforce_assets,
)
from teamster.code_locations.kipptaf._dlt.zendesk.assets import assets as zendesk_assets

assets = [
illuminate_assets,
salesforce_assets,
zendesk_assets,
=======

Check failure on line 15 in src/teamster/code_locations/kipptaf/_dlt/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected `,`, found `==`

Check failure on line 15 in src/teamster/code_locations/kipptaf/_dlt/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected `,`, found `==`

Check failure on line 15 in src/teamster/code_locations/kipptaf/_dlt/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected `,`, found `==`

Check failure on line 15 in src/teamster/code_locations/kipptaf/_dlt/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected `,`, found `=`

# from teamster.code_locations.kipptaf._dlt.salesforce.assets import (
# assets as salesforce_assets,
# )
# from teamster.code_locations.kipptaf._dlt.zendesk.assets import assets as zendesk_assets

assets = [

Check failure on line 22 in src/teamster/code_locations/kipptaf/_dlt/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected `,`, found `=`
*illuminate_assets,
# *zendesk_assets,
# salesforce_assets,
>>>>>>> main

Check failure on line 26 in src/teamster/code_locations/kipptaf/_dlt/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected an expression or a ']'

Check failure on line 26 in src/teamster/code_locations/kipptaf/_dlt/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected an expression or a ']'

Check failure on line 26 in src/teamster/code_locations/kipptaf/_dlt/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected an expression or a ']'

Check failure on line 26 in src/teamster/code_locations/kipptaf/_dlt/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected an expression or a ']'
]

__all__ = [

Check failure on line 29 in src/teamster/code_locations/kipptaf/_dlt/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected `,`, found name

Check failure on line 29 in src/teamster/code_locations/kipptaf/_dlt/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected `,`, found `=`
"assets",
"schedules",
]
2 changes: 1 addition & 1 deletion src/teamster/code_locations/kipptaf/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Definitions,
load_assets_from_modules,
)
from dagster_k8s import k8s_job_executor

Check failure on line 7 in src/teamster/code_locations/kipptaf/definitions.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(F401)

[new] `dagster_k8s.k8s_job_executor` imported but unused

from teamster.code_locations.kipptaf import (
CODE_LOCATION,
Expand Down Expand Up @@ -50,7 +50,7 @@
)

defs = Definitions(
executor=k8s_job_executor,
# executor=k8s_job_executor,
assets=[
*_dbt.asset_specs,
*_google.asset_specs,
Expand Down
19 changes: 19 additions & 0 deletions src/teamster/libraries/dlt/salesforce/assets.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
<<<<<<< HEAD

Check failure on line 1 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 1 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 1 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 1 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 1 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

isort

Incorrect formatting, autoformat by running 'trunk fmt'
import logging

from dagster import AssetExecutionContext, AssetKey
from dagster_dlt import DagsterDltResource, DagsterDltTranslator, dlt_assets
from dlt import pipeline
from dlt.common.runtime.collector import LogCollector
from dlt.destinations import bigquery
=======

Check failure on line 9 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 9 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 9 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 9 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 9 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement
# from dagster import AssetExecutionContext, AssetKey
# from dagster_dlt import DagsterDltResource, DagsterDltTranslator, dlt_assets
# from dlt import pipeline
# from dlt.common.runtime.collector import LogCollector
# from dlt.destinations import bigquery
>>>>>>> main

Check failure on line 15 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 15 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 15 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 15 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

# from teamster.libraries.dlt.salesforce.pipeline import salesforce_source

Expand Down Expand Up @@ -41,12 +51,21 @@
# security_token=salesforce_security_token,
# )

<<<<<<< HEAD

Check failure on line 54 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 54 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 54 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 54 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement
dlt_pipeline = pipeline(

Check failure on line 55 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Unexpected indentation
pipeline_name="kippadb",
destination=bigquery(),
dataset_name=f"dagster_{code_location}_dlt_kippadb",
progress=LogCollector(dump_system_stats=False, log_level=logging.DEBUG),
)
=======

Check failure on line 61 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 61 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 61 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 61 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 61 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement
# dlt_pipeline = pipeline(
# pipeline_name="kippadb",
# destination=bigquery(),
# dataset_name=f"dagster_{code_location}_dlt_kippadb",
# progress=LogCollector(dump_system_stats=False),
# )
>>>>>>> main

Check failure on line 68 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 68 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 68 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 68 in src/teamster/libraries/dlt/salesforce/assets.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

# @dlt_assets(
# dlt_source=dlt_source,
Expand Down
142 changes: 142 additions & 0 deletions src/teamster/libraries/dlt/salesforce/pipeline/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,23 @@
# """
# Retrieves data from Salesforce using the Salesforce API.

<<<<<<< HEAD

Check failure on line 30 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 30 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 30 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 30 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement
Args:

Check failure on line 31 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Unexpected indentation

Check failure on line 31 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected an expression
user_name (str): The username for authentication.

Check failure on line 32 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Compound statements are not allowed on the same line as simple statements

Check failure on line 32 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Invalid annotated assignment target

Check failure on line 32 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Simple statements must be separated by newlines or semicolons

Check failure on line 32 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected an identifier

Check failure on line 32 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Unexpected indentation
Defaults to the value in the `dlt.secrets` object.

Check failure on line 33 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Simple statements must be separated by newlines or semicolons

Check failure on line 33 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Simple statements must be separated by newlines or semicolons

Check failure on line 33 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Got unexpected token `

Check failure on line 33 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Simple statements must be separated by newlines or semicolons

Check failure on line 33 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Got unexpected token `

Check failure on line 33 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected an identifier
password (str): The password for authentication.

Check failure on line 34 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Compound statements are not allowed on the same line as simple statements

Check failure on line 34 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Invalid annotated assignment target

Check failure on line 34 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Simple statements must be separated by newlines or semicolons

Check failure on line 34 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected an identifier
Defaults to the value in the `dlt.secrets` object.

Check failure on line 35 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Got unexpected token `

Check failure on line 35 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected an identifier

Check failure on line 35 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Simple statements must be separated by newlines or semicolons

Check failure on line 35 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Simple statements must be separated by newlines or semicolons

Check failure on line 35 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Got unexpected token `

Check failure on line 35 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Simple statements must be separated by newlines or semicolons
security_token (str): The security token for authentication.

Check failure on line 36 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Compound statements are not allowed on the same line as simple statements

Check failure on line 36 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Simple statements must be separated by newlines or semicolons

Check failure on line 36 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected an identifier

Check failure on line 36 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Invalid annotated assignment target

Check failure on line 36 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Simple statements must be separated by newlines or semicolons
Defaults to the value in the `dlt.secrets` object.

Check failure on line 37 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Got unexpected token `

Check failure on line 37 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected an identifier

Check failure on line 37 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Simple statements must be separated by newlines or semicolons

Check failure on line 37 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Got unexpected token `

Check failure on line 37 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Simple statements must be separated by newlines or semicolons

Check failure on line 37 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Simple statements must be separated by newlines or semicolons
=======

Check failure on line 38 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 38 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 38 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 38 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 38 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement
# Args:
# user_name (str): The username for authentication. Defaults to the value in the
# `dlt.secrets` object.
# password (str): The password for authentication. Defaults to the value in the
# `dlt.secrets` object.
# security_token (str): The security token for authentication. Defaults to the
# value in the `dlt.secrets` object.
>>>>>>> main

Check failure on line 46 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 46 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 46 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 46 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

# Yields:
# DltResource: Data resources from Salesforce.
Expand All @@ -43,6 +53,137 @@
# username=user_name, password=password, security_token=security_token
# )

<<<<<<< HEAD

Check failure on line 56 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 56 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 56 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 56 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement
opportunity_last_timestamp = dlt.sources.incremental(

Check failure on line 57 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Unexpected indentation
cursor_path="SystemModstamp", initial_value=None
)
opportunity_line_item_last_timestamp = dlt.sources.incremental(
cursor_path="SystemModstamp", initial_value=None
)
opportunity_contact_role_last_timestamp = dlt.sources.incremental(
cursor_path="SystemModstamp", initial_value=None
)
account_last_timestamp = dlt.sources.incremental(
cursor_path="LastModifiedDate", initial_value=None
)
campaign_member_last_timestamp = dlt.sources.incremental(
cursor_path="SystemModstamp", initial_value=None
)
task_last_timestamp = dlt.sources.incremental(
cursor_path="SystemModstamp", initial_value=None
)
event_last_timestamp = dlt.sources.incremental(
cursor_path="SystemModstamp", initial_value=None
)

# define resources
@dlt.resource(write_disposition="replace")
def sf_user() -> Iterable[TDataItem]:
yield get_records(sf=client, sobject="User")

@dlt.resource(write_disposition="replace")
def user_role() -> Iterable[TDataItem]:
yield get_records(sf=client, sobject="UserRole")

@dlt.resource(write_disposition="merge")
def opportunity(
last_timestamp: incremental = opportunity_last_timestamp,
) -> Iterable[TDataItem]:
yield get_records(
sf=client,
sobject="Opportunity",
last_state=last_timestamp.last_value,
replication_key="SystemModstamp",
)

@dlt.resource(write_disposition="merge")
def opportunity_line_item(
last_timestamp: incremental = opportunity_line_item_last_timestamp,
) -> Iterable[TDataItem]:
yield get_records(
sf=client,
sobject="OpportunityLineItem",
last_state=last_timestamp.last_value,
replication_key="SystemModstamp",
)

@dlt.resource(write_disposition="merge")
def opportunity_contact_role(
last_timestamp: incremental = opportunity_contact_role_last_timestamp,
) -> Iterable[TDataItem]:
yield get_records(
sf=client,
sobject="OpportunityContactRole",
last_state=last_timestamp.last_value,
replication_key="SystemModstamp",
)

@dlt.resource(write_disposition="merge")
def account(
last_timestamp: incremental = account_last_timestamp,
) -> Iterable[TDataItem]:
yield get_records(
sf=client,
sobject="Account",
last_state=last_timestamp.last_value,
replication_key="LastModifiedDate",
)

@dlt.resource(write_disposition="replace")
def contact() -> Iterable[TDataItem]:
yield get_records(sf=client, sobject="Contact")

@dlt.resource(write_disposition="replace")
def lead() -> Iterable[TDataItem]:
yield get_records(sf=client, sobject="Lead")

@dlt.resource(write_disposition="replace")
def campaign() -> Iterable[TDataItem]:
yield get_records(sf=client, sobject="Campaign")

@dlt.resource(write_disposition="merge")
def campaign_member(
last_timestamp: incremental = campaign_member_last_timestamp,
) -> Iterable[TDataItem]:
yield get_records(
sf=client,
sobject="CampaignMember",
last_state=last_timestamp.last_value,
replication_key="SystemModstamp",
)

@dlt.resource(write_disposition="replace")
def product_2() -> Iterable[TDataItem]:
yield get_records(sf=client, sobject="Product2")

@dlt.resource(write_disposition="replace")
def pricebook_2() -> Iterable[TDataItem]:
yield get_records(sf=client, sobject="Pricebook2")

@dlt.resource(write_disposition="replace")
def pricebook_entry() -> Iterable[TDataItem]:
yield get_records(sf=client, sobject="PricebookEntry")

@dlt.resource(write_disposition="merge")
def task(last_timestamp: incremental = task_last_timestamp) -> Iterable[TDataItem]:
yield get_records(
sf=client,
sobject="Task",
last_state=last_timestamp.last_value,
replication_key="SystemModstamp",
)

@dlt.resource(write_disposition="merge")
def event(
last_timestamp: incremental = event_last_timestamp,
) -> Iterable[TDataItem]:
yield get_records(
sf=client,
sobject="Event",
last_state=last_timestamp.last_value,
replication_key="SystemModstamp",
)
=======

Check failure on line 186 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 186 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 186 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 186 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 186 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement
# # define resources
# @dlt.resource(write_disposition="replace")
# def sf_user() -> Iterable[TDataItem]:
Expand Down Expand Up @@ -144,6 +285,7 @@
# ),
# ) -> Iterable[TDataItem]:
# yield get_records(client, "Event", last_timestamp.last_value, "SystemModstamp")
>>>>>>> main

Check failure on line 288 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 288 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 288 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 288 in src/teamster/libraries/dlt/salesforce/pipeline/__init__.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

# return (
# sf_user,
Expand Down
11 changes: 11 additions & 0 deletions src/teamster/libraries/dlt/salesforce/pipeline/helpers.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# """Salesforce source helpers"""

Check failure on line 1 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

isort

Incorrect formatting, autoformat by running 'trunk fmt'

# from typing import Iterable

<<<<<<< HEAD

Check failure on line 5 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 5 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 5 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 5 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement
import pendulum
from dlt.common.typing import TDataItem
from simple_salesforce.api import Salesforce
=======

Check failure on line 9 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 9 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 9 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 9 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 9 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement
# import pendulum
# from dlt.common.typing import TDataItem
# from simple_salesforce.api import Salesforce, SFType
>>>>>>> main

Check failure on line 13 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 13 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 13 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 13 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

# from teamster.libraries.dlt.salesforce.pipeline.settings import IS_PRODUCTION

Expand All @@ -30,10 +36,15 @@
# Dict[TDataItem]: A dictionary representing a record from the Salesforce sObject.
# """

<<<<<<< HEAD

Check failure on line 39 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 39 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 39 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 39 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement
# Get all fields for the sobject
desc = getattr(sf, sobject).describe()

Check failure on line 41 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Unexpected indentation
=======

Check failure on line 42 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 42 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 42 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 42 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 42 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement
# s_object: SFType = getattr(sf, sobject)

# # Get all fields for the sobject
# desc = s_object.describe()
>>>>>>> main

Check failure on line 47 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 47 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 47 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

Check failure on line 47 in src/teamster/libraries/dlt/salesforce/pipeline/helpers.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(invalid-syntax)

[new] Expected a statement

# # Salesforce returns compound fields as separate fields, so we need to filter them
# # out
Expand Down
22 changes: 22 additions & 0 deletions tests/resources/test_resource_salesforce.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from dagster import EnvVar
from dagster_shared import check
from simple_salesforce.api import Salesforce
from simple_salesforce.login import SalesforceLogin


def test_foo():
session_id, instance = SalesforceLogin(
username=check.not_none(
value=EnvVar("SALESFORCE_KIPPADB_USER_NAME").get_value()
),
password=check.not_none(
value=EnvVar("SALESFORCE_KIPPADB_PASSWORD").get_value()
),
security_token=check.not_none(
value=EnvVar("SALESFORCE_KIPPADB_SECURITY_TOKEN").get_value()
),
)

client = Salesforce(session_id=session_id, instance=instance)

client.describe()
Loading
Loading