Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions .github/workflows/pr_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
- opened
- synchronize
- labeled
paths-ignore:
- 'community/**'
- 'docs/**'
- 'examples/**'

# concurrency is currently broken, see details https://github.com/actions/runner/issues/1532
#concurrency:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pr_local_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- opened
- synchronize
- labeled
paths-ignore:
- 'community/**'
- 'docs/**'
- 'examples/**'

jobs:
integration-test-python-local:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/smoke_tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: smoke-tests

on: [pull_request]
on:
pull_request:
paths-ignore:
- 'community/**'
- 'docs/**'
- 'examples/**'
jobs:
unit-test-python:
runs-on: ${{ matrix.os }}
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: unit-tests

on: [pull_request]
on:
pull_request:
paths-ignore:
- 'community/**'
- 'docs/**'
- 'examples/**'
jobs:
unit-test-python:
runs-on: ${{ matrix.os }}
Expand Down
8 changes: 8 additions & 0 deletions sdk/python/feast/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import warnings
from datetime import datetime
from typing import Dict, List, Optional

Expand Down Expand Up @@ -79,6 +80,13 @@ def __init__(
ValueError: Parameters are specified incorrectly.
"""
self.name = name
if value_type is None:
warnings.warn(
"Entity value_type will be mandatory in the next release. "
"Please specify a value_type for entity '%s'." % name,
DeprecationWarning,
stacklevel=2,
)
self.value_type = value_type or ValueType.UNKNOWN

if join_keys and len(join_keys) > 1:
Expand Down
15 changes: 15 additions & 0 deletions sdk/python/tests/unit/test_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import warnings

import assertpy
import pytest

Expand Down Expand Up @@ -73,3 +75,16 @@ def test_hash():

s4 = {entity1, entity2, entity3, entity4}
assert len(s4) == 3


def test_entity_without_value_type_warns():
with pytest.warns(DeprecationWarning, match="Entity value_type will be mandatory"):
entity = Entity(name="my-entity")
assert entity.value_type == ValueType.UNKNOWN


def test_entity_with_value_type_no_warning():
with warnings.catch_warnings():
warnings.simplefilter("error")
entity = Entity(name="my-entity", value_type=ValueType.STRING)
assert entity.value_type == ValueType.STRING
Loading