Visitar URL original
fix: Fix mypy TorchTensor type alias error by nithin42 · Pull Request #6712 · feast-dev/feast · GitHub
Skip to content
Merged
Changes from 1 commit
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
Next Next commit
fix: Fix mypy TorchTensor type alias error
Fix the TypeAlias annotation of TorchTensor in the fallback branch of online_response.py to stop mypy from treating it as a variable and raising 'not valid as a type'.

Fixes #5563

Signed-off-by: Nithin <kumbam.nithingoud@gmail.com>
  • Loading branch information
nithin42 committed Aug 10, 2026
commit eeb10bc817adc3b00b5f3ea7a661c58df90d2815
7 changes: 3 additions & 4 deletions sdk/python/feast/online_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

import uuid as uuid_module
from typing import TYPE_CHECKING, Any, Dict, List, Optional, TypeAlias, Union
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union

import pandas as pd
import pyarrow as pa
Expand All @@ -26,10 +26,9 @@

if TYPE_CHECKING:
import torch

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must not be needed anymore.


TorchTensor: TypeAlias = torch.Tensor
from torch import Tensor as TorchTensor
else:
TorchTensor: TypeAlias = Any
TorchTensor = Any

TIMESTAMP_POSTFIX: str = "__ts"

Expand Down