Visitar URL original
Added .with_name method in FeatureView/OnDemandFeatureView classes for name aliasing. FeatureViewProjection will hold this information by mavysavydav · Pull Request #1872 · feast-dev/feast · GitHub
Skip to content
Merged
Show file tree
Hide file tree
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
Prev Previous commit
use python's copy lib rather than creating new copy method.
Signed-off-by: David Y Liu <davidyliuliu@gmail.com>
  • Loading branch information
mavysavydav committed Oct 7, 2021
commit 91595cf96320f4d3ada9b7a07f81ece19c7cebe3
3 changes: 2 additions & 1 deletion sdk/python/feast/feature_view.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 copy
import re
import warnings
from datetime import datetime, timedelta
Expand Down Expand Up @@ -226,7 +227,7 @@ def with_name(self, name: str):
online=self.online,
)

fv.set_projection(self.projection.copy)
fv.set_projection(copy.copy(self.projection))
fv.projection.name_to_use = name

return fv
Expand Down
5 changes: 0 additions & 5 deletions sdk/python/feast/feature_view_projection.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ def to_proto(self):

return feature_reference_proto

def copy(self):
return FeatureViewProjection(
name=self.name, name_to_use=self.name_to_use, features=self.features,
)

@staticmethod
def from_proto(proto: FeatureViewProjectionProto):
ref = FeatureViewProjection(
Expand Down
3 changes: 2 additions & 1 deletion sdk/python/feast/on_demand_feature_view.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import copy
import functools
from types import MethodType
from typing import Dict, List, Union, cast
Expand Down Expand Up @@ -82,7 +83,7 @@ def with_name(self, name: str):
name=self.name, features=self.features, inputs=self.inputs, udf=self.udf
)

odfv.set_projection(self.projection.copy)
odfv.set_projection(copy.copy(self.projection))
Comment thread
woop marked this conversation as resolved.
odfv.projection.name_to_use = name

return odfv
Expand Down