-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update pre-commit and use ruff for linting/formating #105
Conversation
@@ -57,7 +56,7 @@ | |||
api = StacApi( | |||
settings=settings, | |||
extensions=extensions, | |||
client=CoreCrudClient(post_request_model=post_request_model), | |||
client=CoreCrudClient(post_request_model=post_request_model), # type: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why I was getting a Mypy error here 🤷
collection_id=collection_id, | ||
item_id=item_id, | ||
collection_id=collection_id, # type: ignore | ||
item_id=item_id, # type: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
collection_id and item_id should always be define but for some reason mypy thinks it can be None
with translate_pgstac_errors(): | ||
async with pool.acquire() as conn: | ||
yield conn | ||
|
||
|
||
async def dbfunc(conn: Connection, func: str, arg: Union[str, Dict]): | ||
async def dbfunc(conn: Connection, func: str, arg: Union[str, Dict, List]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
"rel": Relations.self.value, | ||
"type": MimeTypes.json.value, | ||
"href": self.url, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: using dict()
is slower than constructing a dict using {}
@@ -28,7 +28,7 @@ | |||
class TransactionsClient(AsyncBaseTransactionsClient): | |||
"""Transactions extension specific CRUD operations.""" | |||
|
|||
def _validate_id(self, id: str, settings: Settings) -> bool: | |||
def _validate_id(self, id: str, settings: Settings): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no return on this function
@@ -153,7 +151,8 @@ async def test_returns_valid_links_in_collections(app_client, load_test_data): | |||
# Find collection in list by ID | |||
single_coll = next(coll for coll in collections if coll["id"] == in_json["id"]) | |||
is_coll_from_list_valid = False | |||
single_coll_mocked_link = dict() | |||
|
|||
single_coll_mocked_link: Optional[pystac.Collection] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
single_coll_mocked_link
can't be a dict but has to be a Collection object
@vincentsarago changelog? |
@jonhealy1 I'll wait for #101 to get merged then I'll merge this one to main and then we can do #106 |
This PR updates pre-commit and switch to ruff for formatting/linting (as we did in stac-fastapi)