Skip to content

Commit

Permalink
Merge pull request #62 from maciejzj/develop
Browse files Browse the repository at this point in the history
Release changes v0.2.2 to master
  • Loading branch information
maciejzj authored Nov 13, 2023
2 parents a0bace3 + 7292236 commit b70fd7d
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/quality_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ jobs:
flake8 it_jobs_meta --count --select=E9,F63,F7,F82 --show-source --statistics
# Exit-zero treats all errors as warnings
flake8 it_jobs_meta --count --exit-zero --statistics
- name: Typecheck with mypy
run: |
mypy it_jobs_meta
- name: Test with pytest
run: |
pytest it_jobs_meta
4 changes: 1 addition & 3 deletions it_jobs_meta/common/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def args(self) -> dict[str, Any]:
self._args = vars(self._parser.parse_args())
return self._args

def extract_data_lake(self) -> tuple[DataLakeImpl, Path] | None:
def extract_data_lake(self) -> tuple[DataLakeImpl, Path]:
"""Extract data lake setup from the arguments.
:return: Tuple with the selected data lake implementation type and
Expand All @@ -61,8 +61,6 @@ def extract_data_lake(self) -> tuple[DataLakeImpl, Path] | None:
return DataLakeImpl.REDIS, self.args['redis']
case {'s3_bucket': Path(), 'redis': None}:
return DataLakeImpl.S3BUCKET, self.args['s3_bucket']
case {'s3_bucket': None, 'redis': None}:
return None
case _:
raise ValueError(
'Parsed arguments resulted in unsupported or invalid data'
Expand Down
2 changes: 1 addition & 1 deletion it_jobs_meta/dashboard/data_provision.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(
db_name: str,
port=27017,
):
self._db_client = pymongo.MongoClient(
self._db_client: pymongo.MongoClient = pymongo.MongoClient(
f'mongodb://{user_name}:{password}@{host}:{port}'
)
self._db = self._db_client[db_name]
Expand Down
2 changes: 1 addition & 1 deletion it_jobs_meta/data_pipeline/data_etl.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def __init__(
db_name: str,
port=27017,
):
self._db_client = pymongo.MongoClient(
self._db_client: pymongo.MongoClient = pymongo.MongoClient(
f'mongodb://{user_name}:{password}@{host}:{port}'
)
self._db = self._db_client[db_name]
Expand Down
2 changes: 1 addition & 1 deletion it_jobs_meta/data_pipeline/data_ingestion.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def get(self) -> PostingsData:
return data


class ArchiveNoFluffJObsPostingsDataSource:
class ArchiveNoFluffJObsPostingsDataSource(PostingsDataSource):
"""Load postings data from archive under URL (from data lake or file)"""

def __init__(self, posting_url: str):
Expand Down
4 changes: 2 additions & 2 deletions it_jobs_meta/data_pipeline/data_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ class Schemas:
'id': pa.Column(str),
'city': pa.Column(str),
'lat': pa.Column(
float, pa.Check.ge(-90), pa.Check.le(90), coerce=True
float, pa.Check.ge(-90), pa.Check.le(90), coerce=True # type: ignore # noqa: e510
),
'lon': pa.Column(
float, pa.Check.ge(-180), pa.Check.le(180), coerce=True
float, pa.Check.ge(-180), pa.Check.le(180), coerce=True # type: ignore # noqa: e501
),
}
)
Expand Down
3 changes: 2 additions & 1 deletion it_jobs_meta/data_pipeline/geolocator.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
"""Geolocation services."""

import functools
from typing import Sequence

from geopy.geocoders import Nominatim


class Geolocator:
def __init__(self, country_filter: tuple[str, ...] | None = None):
def __init__(self, country_filter: Sequence[str] | None = None):
"""Create geolocator instance.
:param country_filter: Tuple of country names that the geolocation
Expand Down

0 comments on commit b70fd7d

Please sign in to comment.