mirror of
https://github.com/clearml/clearml
synced 2025-06-26 18:16:07 +00:00
Add new API backward compatibility support
This commit is contained in:
@@ -128,11 +128,14 @@ class NonStrictDataModelMixin(object):
|
||||
:summary: supplies an __init__ method that warns about unused keywords
|
||||
"""
|
||||
def __init__(self, **kwargs):
|
||||
unexpected = [key for key in kwargs if not key.startswith('_')]
|
||||
if unexpected:
|
||||
message = '{}: unused keyword argument(s) {}' \
|
||||
.format(type(self).__name__, unexpected)
|
||||
warnings.warn(message, UnusedKwargsWarning)
|
||||
# unexpected = [key for key in kwargs if not key.startswith('_')]
|
||||
# if unexpected:
|
||||
# message = '{}: unused keyword argument(s) {}' \
|
||||
# .format(type(self).__name__, unexpected)
|
||||
# warnings.warn(message, UnusedKwargsWarning)
|
||||
|
||||
# ignore extra data warnings
|
||||
pass
|
||||
|
||||
|
||||
class NonStrictDataModel(DataModel, NonStrictDataModelMixin):
|
||||
|
||||
Reference in New Issue
Block a user