Skip to content

Commit e028ecc

Browse files
authored
Fix type hints to match actual return values from APIs (#27)
1 parent 7e8317d commit e028ecc

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

src/abstract_api/company_enrichment/company_enrichment_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def industry(self) -> str | None:
2727
return self._get_response_field("industry")
2828

2929
@cached_property
30-
def employees_count(self) -> str | None:
30+
def employees_count(self) -> int | None:
3131
"""The approximate number of employees of the company."""
3232
return self._get_response_field("employees_count")
3333

src/abstract_api/exchange_rates/exchange_rates_conversion_response.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ def date(self) -> str | None:
3232
return self._get_response_field("date")
3333

3434
@cached_property
35-
def base_amount(self) -> str | None:
35+
def base_amount(self) -> float | None:
3636
"""The amount of the base currency from the request."""
3737
return self._get_response_field("base_amount")
3838

3939
@cached_property
40-
def converted_amount(self) -> str | None:
40+
def converted_amount(self) -> float | None:
4141
"""The amount after conversion.
4242
4343
The amount of the target currency that the base_amount has been
@@ -46,11 +46,11 @@ def converted_amount(self) -> str | None:
4646
return self._get_response_field("converted_amount")
4747

4848
@cached_property
49-
def exchange_rate(self) -> str | None:
49+
def exchange_rate(self) -> float | None:
5050
"""The exchange rate used in conversion."""
5151
return self._get_response_field("exchange_rate")
5252

5353
@cached_property
54-
def last_updated(self) -> str | None:
54+
def last_updated(self) -> int | None:
5555
"""The Unix timestamp of when the returned data was last updated."""
5656
return self._get_response_field("last_updated")

src/abstract_api/image_processing/image_processing_response.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,37 +16,37 @@ def __init__(
1616
super().__init__(response, RESPONSE_FIELDS)
1717

1818
@cached_property
19-
def original_size(self) -> str | None:
19+
def original_size(self) -> int | None:
2020
"""The original size of the provided image, in bytes."""
2121
return self._get_response_field("original_size")
2222

2323
@cached_property
24-
def original_height(self) -> str | None:
24+
def original_height(self) -> int | None:
2525
"""The original height of the provided image, in bytes."""
2626
return self._get_response_field("original_height")
2727

2828
@cached_property
29-
def original_width(self) -> str | None:
29+
def original_width(self) -> int | None:
3030
"""The original width of the provided image, in bytes."""
3131
return self._get_response_field("original_width")
3232

3333
@cached_property
34-
def final_size(self) -> str | None:
34+
def final_size(self) -> int | None:
3535
"""The final size of the processed image, in bytes."""
3636
return self._get_response_field("final_size")
3737

3838
@cached_property
39-
def bytes_saved(self) -> str | None:
39+
def bytes_saved(self) -> int | None:
4040
"""The number of bytes saved by optimizing the image, in bytes."""
4141
return self._get_response_field("bytes_saved")
4242

4343
@cached_property
44-
def final_height(self) -> str | None:
44+
def final_height(self) -> int | None:
4545
"""The final height of the processed image, in bytes."""
4646
return self._get_response_field("final_height")
4747

4848
@cached_property
49-
def final_width(self) -> str | None:
49+
def final_width(self) -> int | None:
5050
"""The final width of the processed image, in bytes."""
5151
return self._get_response_field("final_width")
5252

src/abstract_api/timezone/current_timezone_response.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ def timezone_abbreviation(self) -> str | None:
3737
return self._get_response_field("timezone_abbreviation")
3838

3939
@cached_property
40-
def gmt_offset(self) -> str | None:
40+
def gmt_offset(self) -> int | None:
4141
"""Timezone's offset from Greenwich Mean Time (GMT).
4242
4343
Read more: https://greenwichmeantime.com/what-is-gmt
4444
"""
4545
return self._get_response_field("gmt_offset")
4646

4747
@cached_property
48-
def is_dst(self) -> str | None:
48+
def is_dst(self) -> bool | None:
4949
"""Whether the location is currently in Daylight Savings Time (DST).
5050
5151
Read more: https://wikipedia.org/wiki/Daylight_saving_time

src/abstract_api/vat/vat_calculation_response.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ def __init__(self, response: requests.models.Response) -> None:
2020
super().__init__(response, CALCULATION_RESPONSE_FIELDS)
2121

2222
@cached_property
23-
def amount_excluding_vat(self) -> float | None:
23+
def amount_excluding_vat(self) -> str | None:
2424
"""The amount excluding the VAT."""
2525
return self._get_response_field("amount_excluding_vat")
2626

2727
@cached_property
28-
def amount_including_vat(self) -> float | None:
28+
def amount_including_vat(self) -> str | None:
2929
"""The sum of the base amount and the VAT.
3030
3131
It is amount_excl_vat + vat_amount.
3232
"""
3333
return self._get_response_field("amount_including_vat")
3434

3535
@cached_property
36-
def vat_amount(self) -> float | None:
36+
def vat_amount(self) -> str | None:
3737
"""The calculated amount of VAT."""
3838
return self._get_response_field("vat_amount")
3939

@@ -46,7 +46,7 @@ def vat_category(self) -> str | None:
4646
return self._get_response_field("vat_category")
4747

4848
@cached_property
49-
def vat_rate(self) -> float | None:
49+
def vat_rate(self) -> str | None:
5050
"""The VAT rate, from 0.01 to 0.99."""
5151
return self._get_response_field("vat_rate")
5252

0 commit comments

Comments
 (0)