Skip to content

Commit 2b202fc

Browse files
marcromeynbenfred
andauthored
Refactoring Schema (#198)
* Experimenting with ways to define a Schema * Adding create_continuous * Adding create_continuous * Adding prototext support * Refactoring Schema * Fixing flake8 * Updating requirements * Trying to fix failing tests * Fixing failing schema tests * Fixing failing schema tests * Change call of from_proto_txt to new signature * Rename Tags to Tag like it was before * Fixing test_tabular_features_yoochoose_direct * Update tests/utils/test_schema.py Co-authored-by: Ben Frederickson <github@benfrederickson.com> * Fixes according to PR-comments * Running flake8 * Adding copyright + some basic tag tests * Some more updates * Some small refactorings of Schema * Some more tests * Trying to fix failing tests Co-authored-by: Ben Frederickson <github@benfrederickson.com>
1 parent 11772a5 commit 2b202fc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1888
-728
lines changed

merlin_standard_lib/__init__.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (c) 2021, NVIDIA CORPORATION.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
16+
17+
from betterproto import Message
18+
19+
from .registry import Registry, RegistryMixin
20+
from .schema import schema
21+
from .schema.schema import ColumnSchema, Schema
22+
from .schema.tag import Tag
23+
from .utils import proto_utils
24+
25+
# Other monkey-patching
26+
Message.HasField = proto_utils.has_field
27+
Message.copy = proto_utils.copy_better_proto_message
28+
29+
__all__ = ["ColumnSchema", "Schema", "schema", "Tag", "Registry", "RegistryMixin"]

merlin_standard_lib/proto/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright (c) 2021, NVIDIA CORPORATION.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#

merlin_standard_lib/proto/schema_bp.py

Lines changed: 779 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright (c) 2021, NVIDIA CORPORATION.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#

0 commit comments

Comments
 (0)