File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
airbyte_cdk/sources/file_based/file_types Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -37,10 +37,20 @@ def parser_max_n_files_for_parsability(self) -> Optional[int]:
3737
3838 def check_config (self , config : FileBasedStreamConfig ) -> Tuple [bool , Optional [str ]]:
3939 """
40- Verify that this parser is only used with the "Raw Files" format.
41- The validation that this format is only used with "Copy Raw Files" delivery method
42- will be handled at a higher level in the availability strategy.
40+ Verify that this parser is only used with the "Copy Raw Files" delivery method.
4341 """
42+ from airbyte_cdk .sources .file_based .config .abstract_file_based_spec import AbstractFileBasedSpec
43+ from airbyte_cdk .sources .file_based .config .validate_config_transfer_modes import use_file_transfer
44+
45+ # Create a mock config to check if the delivery method is set to use file transfer
46+ mock_config = type ('MockConfig' , (AbstractFileBasedSpec ,), {
47+ 'delivery_method' : config .source_config .delivery_method ,
48+ 'documentation_url' : staticmethod (lambda : "" ),
49+ })()
50+
51+ if not use_file_transfer (mock_config ):
52+ return False , "The 'Raw Files' parser can only be used with the 'Copy Raw Files' delivery method."
53+
4454 return True , None
4555
4656 async def infer_schema (
You can’t perform that action at this time.
0 commit comments