diff options
| author | stuppie | 2026-08-17 16:39:29 -0600 |
|---|---|---|
| committer | stuppie | 2026-08-17 16:39:29 -0600 |
| commit | 29336b5bce66d017d76a4c1fdc5b524a62de423f (patch) | |
| tree | fe82eca72360c056439538c4f241a02465449c49 | |
| parent | b06d566a71d66f709b2be5bf3526a504b59f5e7c (diff) | |
| download | generalresearch-29336b5bce66d017d76a4c1fdc5b524a62de423f.tar.gz generalresearch-29336b5bce66d017d76a4c1fdc5b524a62de423f.zip | |
fix more ruff | None types
| -rw-r--r-- | generalresearch/models/gr/business.py | 2 | ||||
| -rw-r--r-- | generalresearch/models/gr/team.py | 10 | ||||
| -rw-r--r-- | generalresearch/models/innovate/question.py | 2 | ||||
| -rw-r--r-- | generalresearch/models/innovate/survey.py | 2 | ||||
| -rw-r--r-- | generalresearch/models/precision/question.py | 2 | ||||
| -rw-r--r-- | generalresearch/models/prodege/question.py | 2 | ||||
| -rw-r--r-- | generalresearch/models/prodege/survey.py | 2 | ||||
| -rw-r--r-- | generalresearch/models/repdata/question.py | 2 | ||||
| -rw-r--r-- | generalresearch/models/repdata/survey.py | 2 | ||||
| -rw-r--r-- | generalresearch/models/sago/question.py | 2 | ||||
| -rw-r--r-- | generalresearch/models/sago/survey.py | 2 | ||||
| -rw-r--r-- | generalresearch/models/spectrum/question.py | 2 | ||||
| -rw-r--r-- | generalresearch/models/spectrum/survey.py | 2 | ||||
| -rw-r--r-- | generalresearch/models/thl/contest/raffle.py | 2 | ||||
| -rw-r--r-- | generalresearch/models/thl/ipinfo.py | 2 | ||||
| -rw-r--r-- | generalresearch/models/thl/product.py | 6 | ||||
| -rw-r--r-- | generalresearch/models/thl/session.py | 2 |
17 files changed, 23 insertions, 23 deletions
diff --git a/generalresearch/models/gr/business.py b/generalresearch/models/gr/business.py index 3e6573d..4455ff0 100644 --- a/generalresearch/models/gr/business.py +++ b/generalresearch/models/gr/business.py @@ -84,7 +84,7 @@ class BusinessBankAccount(BaseModel): # 'business' is a Class with values that are fetched from the DB. # Initialization is deferred until it is actually needed # (see .prefetch_business()) - business: SkipJsonSchema["Business" | None] = Field(default=None) + business: SkipJsonSchema["Business | None"] = Field(default=None) transfer_method: TransferMethod = Field( description=TransferMethod.as_openapi(), diff --git a/generalresearch/models/gr/team.py b/generalresearch/models/gr/team.py index 2c02f6f..4a18875 100644 --- a/generalresearch/models/gr/team.py +++ b/generalresearch/models/gr/team.py @@ -84,7 +84,7 @@ class Membership(BaseModel): team_id: SkipJsonSchema[PositiveInt] = Field() # prefetch attributes - team: SkipJsonSchema["Team" | None] = Field(default=None) + team: SkipJsonSchema["Team | None"] = Field(default=None) # --- Validators --- @@ -158,7 +158,7 @@ class Team(BaseModel): ds: "GRLDatasets", client: Client, mnt_gr_api: Path, - enriched_session: "EnrichedSessionMerge" | None = None, + enriched_session: "EnrichedSessionMerge | None" = None, ) -> None: self.prefetch_products(thl_pg_config=thl_pg_config) @@ -203,7 +203,7 @@ class Team(BaseModel): ds: "GRLDatasets", client: Client, mnt_gr_api: Path, - enriched_wall: "EnrichedWallMerge" | None = None, + enriched_wall: "EnrichedWallMerge | None" = None, ) -> None: self.prefetch_products(thl_pg_config=thl_pg_config) @@ -281,8 +281,8 @@ class Team(BaseModel): client: "Client", ds: "GRLDatasets", mnt_gr_api: Path | str, - enriched_session: "EnrichedSessionMerge" | None = None, - enriched_wall: "EnrichedWallMerge" | None = None, + enriched_session: "EnrichedSessionMerge | None" = None, + enriched_wall: "EnrichedWallMerge | None" = None, ) -> None: ex_secs = 60 * 60 * 24 * 3 # 3 days diff --git a/generalresearch/models/innovate/question.py b/generalresearch/models/innovate/question.py index 402b35d..d385b42 100644 --- a/generalresearch/models/innovate/question.py +++ b/generalresearch/models/innovate/question.py @@ -142,7 +142,7 @@ class InnovateQuestion(MarketplaceQuestion): @classmethod def from_api( cls, d: dict, country_iso: str, language_iso: str - ) -> "InnovateQuestion" | None: + ) -> "InnovateQuestion | None": """ :param d: Raw response from API :param country_iso: diff --git a/generalresearch/models/innovate/survey.py b/generalresearch/models/innovate/survey.py index 8b5d24c..985947e 100644 --- a/generalresearch/models/innovate/survey.py +++ b/generalresearch/models/innovate/survey.py @@ -261,7 +261,7 @@ class InnovateSurvey(MarketplaceTask): return data @classmethod - def from_api(cls, d: dict[str, Any]) -> "InnovateSurvey" | None: + def from_api(cls, d: dict[str, Any]) -> "InnovateSurvey | None": try: return cls._from_api(d) except Exception as e: diff --git a/generalresearch/models/precision/question.py b/generalresearch/models/precision/question.py index d508086..e74a46a 100644 --- a/generalresearch/models/precision/question.py +++ b/generalresearch/models/precision/question.py @@ -106,7 +106,7 @@ class PrecisionQuestion(MarketplaceQuestion): return self @classmethod - def from_api(cls, d: dict[str, Any]) -> "PrecisionQuestion" | None: + def from_api(cls, d: dict[str, Any]) -> "PrecisionQuestion | None": """ :param d: Raw response from API """ diff --git a/generalresearch/models/prodege/question.py b/generalresearch/models/prodege/question.py index f8741c9..f1f9230 100644 --- a/generalresearch/models/prodege/question.py +++ b/generalresearch/models/prodege/question.py @@ -139,7 +139,7 @@ class ProdegeQuestion(MarketplaceQuestion): return self @classmethod - def from_api(cls, d: dict[str, Any], country_iso: str) -> "ProdegeQuestion" | None: + def from_api(cls, d: dict[str, Any], country_iso: str) -> "ProdegeQuestion | None": """ :param d: Raw response from API """ diff --git a/generalresearch/models/prodege/survey.py b/generalresearch/models/prodege/survey.py index 76af35d..6c4e4fc 100644 --- a/generalresearch/models/prodege/survey.py +++ b/generalresearch/models/prodege/survey.py @@ -510,7 +510,7 @@ class ProdegeSurvey(MarketplaceTask): return round(float(v), 2) @classmethod - def from_api(cls, d: dict[str, Any]) -> "ProdegeSurvey" | None: + def from_api(cls, d: dict[str, Any]) -> "ProdegeSurvey | None": try: return cls._from_api(d) except Exception as e: diff --git a/generalresearch/models/repdata/question.py b/generalresearch/models/repdata/question.py index bd5fded..95df1e2 100644 --- a/generalresearch/models/repdata/question.py +++ b/generalresearch/models/repdata/question.py @@ -161,7 +161,7 @@ class RepDataQuestion(MarketplaceQuestion): @classmethod def from_api( cls, d: dict[str, Any], country_iso: str, language_iso: str - ) -> "RepDataQuestion" | None: + ) -> "RepDataQuestion | None": """ :param d: Raw response from API """ diff --git a/generalresearch/models/repdata/survey.py b/generalresearch/models/repdata/survey.py index cfc58af..cb204d1 100644 --- a/generalresearch/models/repdata/survey.py +++ b/generalresearch/models/repdata/survey.py @@ -472,7 +472,7 @@ class RepDataSurvey(BaseModel): return ",".join(map(str, sorted([d.value for d in self.allowed_devices]))) @classmethod - def from_api(cls, survey_response) -> "RepDataSurvey" | None: + def from_api(cls, survey_response) -> "RepDataSurvey | None": """ :param survey_response: Raw response from API """ diff --git a/generalresearch/models/sago/question.py b/generalresearch/models/sago/question.py index f1ef8b4..6d55c49 100644 --- a/generalresearch/models/sago/question.py +++ b/generalresearch/models/sago/question.py @@ -173,7 +173,7 @@ class SagoQuestion(MarketplaceQuestion): @classmethod def from_api( cls, d: dict[str, Any], country_iso: str, language_iso: str - ) -> "SagoQuestion" | None: + ) -> "SagoQuestion | None": """ :param d: Raw response from API :param country_iso: diff --git a/generalresearch/models/sago/survey.py b/generalresearch/models/sago/survey.py index b07c846..2be6863 100644 --- a/generalresearch/models/sago/survey.py +++ b/generalresearch/models/sago/survey.py @@ -259,7 +259,7 @@ class SagoSurvey(MarketplaceTask): } @classmethod - def from_api(cls, d: dict[str, Any]) -> "SagoSurvey" | None: + def from_api(cls, d: dict[str, Any]) -> "SagoSurvey | None": try: return cls._from_api(d) except Exception as e: diff --git a/generalresearch/models/spectrum/question.py b/generalresearch/models/spectrum/question.py index b544c5e..476e92c 100644 --- a/generalresearch/models/spectrum/question.py +++ b/generalresearch/models/spectrum/question.py @@ -252,7 +252,7 @@ class SpectrumQuestion(MarketplaceQuestion): @classmethod def from_api( cls, d: dict[str, Any], country_iso: str, language_iso: str - ) -> "SpectrumQuestion" | None: + ) -> "SpectrumQuestion | None": # To not pollute our logs, we know we are skipping any question that # meets the following conditions: if not SpectrumQuestionType.from_api(d["type"]): diff --git a/generalresearch/models/spectrum/survey.py b/generalresearch/models/spectrum/survey.py index 3683745..0be4d09 100644 --- a/generalresearch/models/spectrum/survey.py +++ b/generalresearch/models/spectrum/survey.py @@ -321,7 +321,7 @@ class SpectrumSurvey(MarketplaceTask): } @classmethod - def from_api(cls, d: dict[str, Any]) -> "SpectrumSurvey" | None: + def from_api(cls, d: dict[str, Any]) -> "SpectrumSurvey | None": try: return cls._from_api(d) except Exception as e: diff --git a/generalresearch/models/thl/contest/raffle.py b/generalresearch/models/thl/contest/raffle.py index 4f868a0..b9a6e31 100644 --- a/generalresearch/models/thl/contest/raffle.py +++ b/generalresearch/models/thl/contest/raffle.py @@ -146,7 +146,7 @@ class RaffleContest(RaffleContestCreate, Contest): return winners - def should_end(self) -> tuple[bool, "ContestEndReason" | None]: + def should_end(self) -> tuple[bool, "ContestEndReason | None"]: res, msg = super().should_end() if res: return res, msg diff --git a/generalresearch/models/thl/ipinfo.py b/generalresearch/models/thl/ipinfo.py index 5a8e51d..5e4e59d 100644 --- a/generalresearch/models/thl/ipinfo.py +++ b/generalresearch/models/thl/ipinfo.py @@ -267,7 +267,7 @@ class IPInformation(BaseModel): return self.is_anonymous is None @property - def geoname(self) -> "IPGeoname" | None: + def geoname(self) -> "IPGeoname | None": return self._geoname or None def normalize_ip(self): diff --git a/generalresearch/models/thl/product.py b/generalresearch/models/thl/product.py index 47e50d0..53f4823 100644 --- a/generalresearch/models/thl/product.py +++ b/generalresearch/models/thl/product.py @@ -941,7 +941,7 @@ class Product(BaseModel, validate_assignment=True): # Initialization is deferred until unless it's called # (see .prebuild_***()) - balance: "ProductBalances" | None = Field( + balance: "ProductBalances | None" = Field( default=None, description="Product Balance" ) @@ -1061,7 +1061,7 @@ class Product(BaseModel, validate_assignment=True): thl_lm: "ThlLedgerManager", ds: "GRLDatasets", client: Client, - pop_ledger: "PopLedgerMerge" | None = None, + pop_ledger: "PopLedgerMerge | None" = None, ) -> None: """ This returns the Product's Balances that are calculated across @@ -1142,7 +1142,7 @@ class Product(BaseModel, validate_assignment=True): thl_lm: "ThlLedgerManager", ds: "GRLDatasets", client: Client, - pop_ledger: "PopLedgerMerge" | None = None, + pop_ledger: "PopLedgerMerge | None" = None, ) -> None: """This is very similar to the Product POP Financial endpoint; however, it returns more than one item for a single time interval. This is diff --git a/generalresearch/models/thl/session.py b/generalresearch/models/thl/session.py index fbaf0e7..dc27ba0 100644 --- a/generalresearch/models/thl/session.py +++ b/generalresearch/models/thl/session.py @@ -983,7 +983,7 @@ class Session(BaseModel): def determine_payments( self, - thl_ledger_manager: "ThlLedgerManager" | None = None, + thl_ledger_manager: "ThlLedgerManager | None" = None, ) -> tuple[Decimal, Decimal, Decimal, Decimal | None]: # How much we should get paid by the MPs for all completes in this # session (usually 0 or 1 completes) |
