-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
datasetIssues or pull requests related to datasetsIssues or pull requests related to datasets
Milestone
Description
Currently, get_dataset_splits() in our datasets is a static method (@staticmethod), but it would be more appropriate to have it marked as a class method (@classmethod).
The following example shows the difference between these two:
class A:
@staticmethod
def x():
A.y()
@staticmethod
def y():
print('Ay')
class B(A):
@staticmethod
def y():
print('By')B.x() prints Ay
class A:
@classmethod
def x(cls):
cls.y()
@staticmethod
def y():
print('Ay')
class B(A):
@staticmethod
def y():
print('By')B.x() prints By
In our datasets, x corresponds to get_dataset_splits and y corresponds to get_default_fields. The issue is that our current pattern doesn't support overriding get_default_fields by a subclass as can be seen in the example above (replace print with return fields), without overriding get_dataset_splits as well. We have this scenario in the SNLI dataset so this is the main reason why I'm opening this issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
datasetIssues or pull requests related to datasetsIssues or pull requests related to datasets