Skip to content

Commit

Permalink
more strict type hinting and casting for linting
Browse files Browse the repository at this point in the history
Signed-off-by: tdhooghe <thomas_dhooghe@mckinsey.com>
  • Loading branch information
tdhooghe committed Oct 21, 2024
1 parent bcc583d commit 20a76ee
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions kedro-datasets/kedro_datasets/snowflake/snowpark_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import annotations

import logging
from typing import Any
from typing import Any, cast

import pandas as pd
import snowflake.snowpark as sp
Expand Down Expand Up @@ -273,8 +273,9 @@ def _validate_and_get_table_name(self) -> str:
Raises:
ValueError: If any part of the table name is None.
"""
parts = [self._database, self._schema, self._table_name]
parts: list[str | None] = [self._database, self._schema, self._table_name]
if any(part is None for part in parts):
raise ValueError(f"Table name parts cannot be None: {parts}")

return ".".join(parts)
parts_str = cast(list[str], parts) # make linting happy
return ".".join(parts_str)

0 comments on commit 20a76ee

Please sign in to comment.