Skip to content

Commit

Permalink
file-transfer(cdk): fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aldogonzalez8 committed Nov 6, 2024
1 parent fa5a59a commit 7d25f66
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import tempfile
from datetime import datetime
from io import IOBase
from typing import Any, Iterable, List, Mapping, Optional
from typing import Any, Iterable, List, Mapping, Optional, Dict

import avro.io as ai
import avro.schema as avro_schema
Expand Down Expand Up @@ -113,6 +113,9 @@ def get_matching_files(
def file_size(self, file: RemoteFile) -> int:
return 0

def get_file(self, file: RemoteFile, local_directory: str, logger: logging.Logger) -> Dict[str, Any]:
return {}

def open_file(self, file: RemoteFile, mode: FileReadMode, encoding: Optional[str], logger: logging.Logger) -> IOBase:
if self.file_type == "csv":
return self._make_csv_file_contents(file.uri)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#

import logging
from io import IOBase
from typing import Any, Iterable, List, Mapping, Optional, Set
from typing import Any, Iterable, List, Mapping, Optional, Dict, Set

import pytest
from airbyte_cdk.sources.file_based.config.abstract_file_based_spec import AbstractFileBasedSpec
Expand Down Expand Up @@ -76,6 +77,9 @@ def open_file(self, file: RemoteFile) -> IOBase:
def file_size(self, file: RemoteFile) -> int:
return 0

def get_file(self, file: RemoteFile, local_directory: str, logger: logging.Logger) -> Dict[str, Any]:
return {}


class TestSpec(AbstractFileBasedSpec):
@classmethod
Expand Down

0 comments on commit 7d25f66

Please sign in to comment.