Skip to content

Commit 91595cf

Browse files
committed
use python's copy lib rather than creating new copy method.
Signed-off-by: David Y Liu <davidyliuliu@gmail.com>
1 parent d5cf2c5 commit 91595cf

3 files changed

Lines changed: 4 additions & 7 deletions

File tree

sdk/python/feast/feature_view.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
import copy
1415
import re
1516
import warnings
1617
from datetime import datetime, timedelta
@@ -226,7 +227,7 @@ def with_name(self, name: str):
226227
online=self.online,
227228
)
228229

229-
fv.set_projection(self.projection.copy)
230+
fv.set_projection(copy.copy(self.projection))
230231
fv.projection.name_to_use = name
231232

232233
return fv

sdk/python/feast/feature_view_projection.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ def to_proto(self):
2323

2424
return feature_reference_proto
2525

26-
def copy(self):
27-
return FeatureViewProjection(
28-
name=self.name, name_to_use=self.name_to_use, features=self.features,
29-
)
30-
3126
@staticmethod
3227
def from_proto(proto: FeatureViewProjectionProto):
3328
ref = FeatureViewProjection(

sdk/python/feast/on_demand_feature_view.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import copy
12
import functools
23
from types import MethodType
34
from typing import Dict, List, Union, cast
@@ -82,7 +83,7 @@ def with_name(self, name: str):
8283
name=self.name, features=self.features, inputs=self.inputs, udf=self.udf
8384
)
8485

85-
odfv.set_projection(self.projection.copy)
86+
odfv.set_projection(copy.copy(self.projection))
8687
odfv.projection.name_to_use = name
8788

8889
return odfv

0 commit comments

Comments
 (0)