Skip to content

Commit

Permalink
Formatted code with black
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishmeet Bindra committed Jan 9, 2024
1 parent b66363c commit 1a69090
Show file tree
Hide file tree
Showing 4 changed files with 215 additions and 102 deletions.
8 changes: 2 additions & 6 deletions pydanticrud/backends/dynamodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def _to_epoch_decimal(dt: datetime) -> Decimal:

def chunk_list(lst, size):
for i in range(0, len(lst), size):
yield lst[i: i + size]
yield lst[i : i + size]


def index_definition(index_name, keys, gsi=False):
Expand Down Expand Up @@ -139,15 +139,11 @@ def _get_type_possibilities(self, field_name) -> Set[tuple]:
possible_types.append(field_properties.get("$ref", field_properties))

def type_from_definition(definition_signature: Union[str, dict]) -> dict:
print("Definition Signature")
print(definition_signature)
if isinstance(definition_signature, str):
print("Inside condition")
t = definition_signature.split("/")[-1]
return self.definitions[t]
return definition_signature
print("Possible Types")
print(possible_types)

type_dicts = [type_from_definition(t) for t in possible_types]

return set([(t["type"], t.get("format", "")) for t in type_dicts])
Expand Down
2 changes: 1 addition & 1 deletion tests/random_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def random_datetime():
random.randint(1, 28),
random.randint(1, 12),
random.randint(1, 59),
0
0,
)


Expand Down
Loading

0 comments on commit 1a69090

Please sign in to comment.