コード例 #1
0
def read_stream(
    source: SourceHubspot, config: Mapping, catalog: ConfiguredAirbyteCatalog, state: MutableMapping = None
) -> Tuple[Mapping, List]:
    records = {}
    states = []
    for message in source.read(AirbyteLogger(), config, catalog, state):
        if message.type == Type.RECORD:
            records.setdefault(message.record.stream, [])
            records[message.record.stream].append(message.record)
        elif message.type == Type.STATE:
            states.append(message.state)

    return records, states
コード例 #2
0
ファイル: test_source.py プロジェクト: Mu-L/airbyte
def test_it_should_not_read_quotes_stream_if_it_does_not_exist_in_client(
        oauth_config, configured_catalog):
    """
    If 'quotes' stream is not in the client, it should skip it.
    """
    source = SourceHubspot()

    all_records = list(
        source.read(logger,
                    config=oauth_config,
                    catalog=configured_catalog,
                    state=None))
    records = [record for record in all_records if record.type == Type.RECORD]
    assert not records