Skip to content

Commit d1f01b7

Browse files
committed
Sometimes we don't want to fail when there's no files found
1 parent 829cddb commit d1f01b7

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

tap_universal_file/files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def get_files(
133133
yield file_dict
134134
continue
135135

136-
if none_found:
136+
if self.config["fail_when_no_files_found"] and none_found:
137137
msg = (
138138
"No files found. Choose a different `file_path` or try a more lenient "
139139
"`file_regex`."

tap_universal_file/tap.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ class TapUniversalFile(Tap):
9090
"matching file extension, appropriately configure `file_regex`."
9191
),
9292
),
93+
th.Property(
94+
"fail_when_no_files_found",
95+
th.BooleanType,
96+
default=True,
97+
description="Fail when no files are found",
98+
),
9399
th.Property(
94100
"compression",
95101
th.StringType,

0 commit comments

Comments
 (0)