Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
14 lines
546 B
Python
14 lines
546 B
Python
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.
|
|
|
|
from typing import Any
|
|
|
|
from airbyte_cdk.sources.file_based.stream import DefaultFileBasedStream
|
|
from source_gcs.helpers import GCSUploadableRemoteFile
|
|
|
|
|
|
class GCSStream(DefaultFileBasedStream):
|
|
def transform_record(self, record: dict[str, Any], file: GCSUploadableRemoteFile, last_updated: str) -> dict[str, Any]:
|
|
record[self.ab_last_mod_col] = last_updated
|
|
record[self.ab_file_name_col] = file.displayed_uri if file.displayed_uri else file.uri
|
|
return record
|