Skip to content

Commit

Permalink
✨ Source Salesforce: Bulk stream uses async CDK components (#45678)
Browse files Browse the repository at this point in the history
Signed-off-by: Artem Inzhyyants <artem.inzhyyants@gmail.com>
Co-authored-by: Artem Inzhyyants <36314070+artem1205@users.noreply.github.com>
  • Loading branch information
maxi297 and artem1205 authored Oct 3, 2024
1 parent bbb9c2e commit 07365b0
Show file tree
Hide file tree
Showing 22 changed files with 6,815 additions and 1,005 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@

import pytest
import requests_mock
from airbyte_cdk.models import ConfiguredAirbyteCatalog, SyncMode
from airbyte_cdk.models import SyncMode
from airbyte_cdk.sources.streams import Stream
from airbyte_cdk.test.catalog_builder import CatalogBuilder
from source_salesforce.source import SourceSalesforce

HERE = Path(__file__).parent
_ANY_CATALOG = ConfiguredAirbyteCatalog.parse_obj({"streams": []})
_ANY_CATALOG = CatalogBuilder().build()
_ANY_CONFIG = {}
_ANY_STATE = {}

Expand Down Expand Up @@ -45,19 +46,6 @@ def get_any_real_stream(input_config: Mapping[str, Any]) -> Stream:
return get_stream(input_config, "ActiveFeatureLicenseMetric")


def test_not_queryable_stream(caplog, input_config):
stream = get_any_real_stream(input_config)
url = f"{stream._legacy_stream.sf_api.instance_url}/services/data/{stream._legacy_stream.sf_api.version}/jobs/query"

# test non queryable BULK streams
query = "Select Id, Subject from ActivityHistory"
with caplog.at_level(logging.WARNING):
assert stream._legacy_stream.create_stream_job(query, url) is None, "this stream should be skipped"

# check logs
assert "is not queryable" in caplog.records[-1].message


@pytest.mark.parametrize(
"stream_name,log_messages",
(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import pytest
import requests
from airbyte_cdk.models import SyncMode
from airbyte_protocol.models import ConfiguredAirbyteCatalog
from airbyte_cdk.test.catalog_builder import CatalogBuilder
from source_salesforce.api import Salesforce
from source_salesforce.source import SourceSalesforce

Expand All @@ -22,7 +22,7 @@
NOTE_CONTENT = "It's the note for integration test"
UPDATED_NOTE_CONTENT = "It's the updated note for integration test"

_ANY_CATALOG = ConfiguredAirbyteCatalog.parse_obj({"streams": []})
_ANY_CATALOG = CatalogBuilder().build()
_ANY_CONFIG = {}
_ANY_STATE = {}

Expand Down
Loading

0 comments on commit 07365b0

Please sign in to comment.