Skip to content

Commit

Permalink
add back fork for legacy tests ;(
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-stauffer committed May 16, 2024
1 parent 5d26129 commit b9e6f81
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from great_expectations.datasource.fluent.data_connector.regex_parser import (
RegExParser,
)
from great_expectations.exceptions import InvalidBatchRequestError

if TYPE_CHECKING:
from typing import DefaultDict
Expand Down Expand Up @@ -215,9 +214,12 @@ def _get_file_batch_definition_list(
# Use a combination of a list and set to preserve iteration order
batch_definition_list: list[LegacyBatchDefinition] = list()
batch_definition_set = set()
if not batch_request.partitioner:
raise InvalidBatchRequestError(message="BatchRequest requires a Partitioner.")
batching_regex = self._preprocess_batching_regex(batch_request.partitioner.regex)
if batch_request.partitioner:
batching_regex = self._preprocess_batching_regex(batch_request.partitioner.regex)
else:
# all batch requests coming from the V1 API should have a regex; to support legacy code
# we fall back to the MATCH_ALL_PATTERN if it's missing.
batching_regex = self._preprocess_batching_regex(MATCH_ALL_PATTERN)
for batch_definition in self._get_batch_definitions(batching_regex=batching_regex):
if (
self._batch_definition_matches_batch_request(
Expand Down

0 comments on commit b9e6f81

Please sign in to comment.