Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Bump fastapi dependencies #614

Merged
merged 3 commits into from
Jun 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
black==21.8b0
black==22.3.0
Faker==8.12.1
ipython
isort
Expand Down
13 changes: 3 additions & 10 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,36 +1,29 @@
alembic==1.6.5
APScheduler==3.8.0
bcrypt~=3.2.0
boto3~=1.18.14
click==7.1.2
click==8.1.3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the secret to getting this to pass? I struggled with this yesterday

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like black was also bumped to v22.3.0 in ada24f8.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did have issues with black and the older version of click so that may be it.

cryptography~=3.4.8
dask==2021.10.0
email-validator
emails
fastapi-caching[redis]
fastapi-pagination[sqlalchemy]~= 0.8.3
fastapi[all]==0.68.1
fastapi[all]==0.78.0
fideslang==1.0.0
multidimensional_urlencode==0.0.4
pandas==1.3.3
passlib[bcrypt]==1.7.2
passlib[bcrypt]==1.7.4
psycopg2-binary==2.9.1
pydantic~=1.8.2
pydash==5.0.2
pyjwt
pymongo==3.12.0
PyMySQL==1.0.2
python-dotenv~=0.19.0
python-jose[cryptography]==3.3.0
redis==3.5.3
requests~=2.25.0
snowflake-sqlalchemy==1.3.2
sqlalchemy-bigquery==1.3.0
sqlalchemy-redshift==0.8.8
sqlalchemy-stubs==0.4
SQLAlchemy-Utils==0.37.8
sqlalchemy==1.4.14
starlette~=0.14.2
Unidecode==1.2.0
uvicorn~=0.13.4
versioneer==0.19
15 changes: 15 additions & 0 deletions src/fidesops/graph/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,12 @@ def collect_matching(self, func: Callable[[Field], bool]) -> Dict[FieldPath, Fie
return {FieldPath(self.name): self} # pylint: disable=no-member
return {}

def __eq__(self, other: object) -> bool:
if not isinstance(other, ScalarField):
return False

return self.__dict__ == other.__dict__


class ObjectField(Field):
"""A field that represents a json dict structure."""
Expand Down Expand Up @@ -345,6 +351,15 @@ def collect_matching(self, func: Callable[[Field], bool]) -> Dict[FieldPath, Fie
},
)

def __eq__(self, other: object) -> bool:
if not isinstance(other, ObjectField):
return False

print(f"{self.__dict__=}")
print(f"{other.__dict__=}")

return self.__dict__ == other.__dict__


# pylint: disable=too-many-arguments
def generate_field(
Expand Down
18 changes: 18 additions & 0 deletions src/fidesops/graph/data_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ def truncate(self, length: int, val: T) -> T:
)
return val

def __eq__(self, other: object) -> bool:
if not isinstance(other, DataTypeConverter):
return False

return self.__dict__ == other.__dict__


class NoOpTypeConverter(DataTypeConverter[Any]):
"""Placeholder No-op converter. This type is assigned to fields when type is unspecified."""
Expand Down Expand Up @@ -133,6 +139,12 @@ def to_value(self, other: Any) -> Optional[ObjectId]:
return None
return None

def __eq__(self, other: object) -> bool:
if not isinstance(other, ObjectTypeConverter):
return False

return self.__dict__ == other.__dict__


class ObjectTypeConverter(DataTypeConverter[Dict[str, Any]]):
"""Json data type converter."""
Expand All @@ -146,6 +158,12 @@ def to_value(self, other: Any) -> Optional[Dict[str, Any]]:
return other
return None

def __eq__(self, other: object) -> bool:
if not isinstance(other, ObjectTypeConverter):
return False

return self.__dict__ == other.__dict__


class DataType(Enum):
"""Supported data types for data retrieval and erasure.
Expand Down
1 change: 1 addition & 0 deletions tests/graph/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ def _is_string_field(f: Field):
assert (
isinstance(object_array_field, ObjectField) and object_array_field.is_array
)
print(object_field)
assert object_array_field.fields["obj"] == object_field

def test_field_data_type(self):
Expand Down
72 changes: 30 additions & 42 deletions tests/service/connectors/test_queryconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,57 +70,45 @@ def found_query_keys(node: TraversalNode, values: Dict[str, Any]) -> Set[str]:
}

# values exist for all query keys
assert (
found_query_keys(
payment_card_node,
{
"id": ["A"],
"customer_id": ["V"],
"ignore_me": ["X"],
},
)
== {"id", "customer_id"}
)
assert found_query_keys(
payment_card_node,
{
"id": ["A"],
"customer_id": ["V"],
"ignore_me": ["X"],
},
) == {"id", "customer_id"}
# with no values OR an empty set, these are omitted
assert (
found_query_keys(
payment_card_node,
{
"id": ["A"],
"customer_id": [],
"ignore_me": ["X"],
},
)
== {"id"}
)
assert found_query_keys(
payment_card_node,
{
"id": ["A"],
"customer_id": [],
"ignore_me": ["X"],
},
) == {"id"}
assert found_query_keys(
payment_card_node, {"id": ["A"], "ignore_me": ["X"]}
) == {"id"}
assert found_query_keys(payment_card_node, {"ignore_me": ["X"]}) == set()
assert found_query_keys(payment_card_node, {}) == set()

def test_typed_filtered_values(self):
assert (
payment_card_node.typed_filtered_values(
{
"id": ["A"],
"customer_id": ["V"],
"ignore_me": ["X"],
}
)
== {"id": ["A"], "customer_id": ["V"]}
)
assert payment_card_node.typed_filtered_values(
{
"id": ["A"],
"customer_id": ["V"],
"ignore_me": ["X"],
}
) == {"id": ["A"], "customer_id": ["V"]}

assert (
payment_card_node.typed_filtered_values(
{
"id": ["A"],
"customer_id": [],
"ignore_me": ["X"],
}
)
== {"id": ["A"]}
)
assert payment_card_node.typed_filtered_values(
{
"id": ["A"],
"customer_id": [],
"ignore_me": ["X"],
}
) == {"id": ["A"]}

assert payment_card_node.typed_filtered_values(
{"id": ["A"], "ignore_me": ["X"]}
Expand Down