Skip to content
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
Empty file.
20 changes: 20 additions & 0 deletions src/external/pdap/impl/follows/core.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from pdap_access_manager import AccessManager, DataSourcesNamespaces, RequestInfo, RequestType, ResponseInfo

Check warning on line 1 in src/external/pdap/impl/follows/core.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] src/external/pdap/impl/follows/core.py#L1 <100>

Missing docstring in public module
Raw output
./src/external/pdap/impl/follows/core.py:1:1: D100 Missing docstring in public module

Check warning on line 1 in src/external/pdap/impl/follows/core.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] src/external/pdap/impl/follows/core.py#L1 <401>

'pdap_access_manager.DataSourcesNamespaces' imported but unused
Raw output
./src/external/pdap/impl/follows/core.py:1:1: F401 'pdap_access_manager.DataSourcesNamespaces' imported but unused

from src.external.pdap.impl.follows.response import GetFollowsResponse, LinkUserFollow

Check warning on line 3 in src/external/pdap/impl/follows/core.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] src/external/pdap/impl/follows/core.py#L3 <401>

'src.external.pdap.impl.follows.response.LinkUserFollow' imported but unused
Raw output
./src/external/pdap/impl/follows/core.py:3:1: F401 'src.external.pdap.impl.follows.response.LinkUserFollow' imported but unused


async def get_user_followed_locations(

Check warning on line 6 in src/external/pdap/impl/follows/core.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] src/external/pdap/impl/follows/core.py#L6 <103>

Missing docstring in public function
Raw output
./src/external/pdap/impl/follows/core.py:6:1: D103 Missing docstring in public function
access_manager: AccessManager,
) -> GetFollowsResponse:

url: str = f"{access_manager.data_sources_url}/v3/v2/source-collector/follows"
headers: dict[str, str] = await access_manager.jwt_header()
request_info = RequestInfo(
type_=RequestType.GET,
url=url,
headers=headers
)
response_info: ResponseInfo = await access_manager.make_request(request_info)
return GetFollowsResponse(
**response_info.data
)

Check warning on line 20 in src/external/pdap/impl/follows/core.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] src/external/pdap/impl/follows/core.py#L20 <292>

no newline at end of file
Raw output
./src/external/pdap/impl/follows/core.py:20:6: W292 no newline at end of file
11 changes: 11 additions & 0 deletions src/external/pdap/impl/follows/response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from pydantic import BaseModel

Check warning on line 1 in src/external/pdap/impl/follows/response.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] src/external/pdap/impl/follows/response.py#L1 <100>

Missing docstring in public module
Raw output
./src/external/pdap/impl/follows/response.py:1:1: D100 Missing docstring in public module


class LinkUserFollow(BaseModel):

Check warning on line 4 in src/external/pdap/impl/follows/response.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] src/external/pdap/impl/follows/response.py#L4 <101>

Missing docstring in public class
Raw output
./src/external/pdap/impl/follows/response.py:4:1: D101 Missing docstring in public class
user_id: int
location_id: int


class GetFollowsResponse(BaseModel):

Check warning on line 9 in src/external/pdap/impl/follows/response.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] src/external/pdap/impl/follows/response.py#L9 <101>

Missing docstring in public class
Raw output
./src/external/pdap/impl/follows/response.py:9:1: D101 Missing docstring in public class
follows: list[LinkUserFollow]

Check warning on line 11 in src/external/pdap/impl/follows/response.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] src/external/pdap/impl/follows/response.py#L11 <391>

blank line at end of file
Raw output
./src/external/pdap/impl/follows/response.py:11:1: W391 blank line at end of file
7 changes: 7 additions & 0 deletions tests/manual/external/pdap/test_get_follows.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import pytest

Check warning on line 1 in tests/manual/external/pdap/test_get_follows.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] tests/manual/external/pdap/test_get_follows.py#L1 <100>

Missing docstring in public module
Raw output
./tests/manual/external/pdap/test_get_follows.py:1:1: D100 Missing docstring in public module


@pytest.mark.asyncio
async def test_get_user_followed_locations(pdap_client_dev):

Check warning on line 5 in tests/manual/external/pdap/test_get_follows.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] tests/manual/external/pdap/test_get_follows.py#L5 <103>

Missing docstring in public function
Raw output
./tests/manual/external/pdap/test_get_follows.py:5:1: D103 Missing docstring in public function
response = await pdap_client_dev.get_user_followed_locations()
print(response)

Check warning on line 7 in tests/manual/external/pdap/test_get_follows.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] tests/manual/external/pdap/test_get_follows.py#L7 <292>

no newline at end of file
Raw output
./tests/manual/external/pdap/test_get_follows.py:7:20: W292 no newline at end of file