TheNeuralBit commented on a change in pull request #14361:
URL: https://github.com/apache/beam/pull/14361#discussion_r610773229



##########
File path: sdks/python/apache_beam/dataframe/frames.py
##########
@@ -783,6 +783,33 @@ def nsmallest(self, keep, **kwargs):
               preserves_partition_by=partitionings.Arbitrary(),
               requires_partition_by=partitionings.Singleton()))
 
+  @property
+  def is_unique(self):
+    def set_index(s):
+      s = s[:]
+      s.index = s

Review comment:
       Thanks thats a good question. I did some local experiments and it looks 
like anything _can_ be placed in the index. I added some test cases for other 
dtypes (floats and strings) to be sure.

##########
File path: sdks/python/apache_beam/dataframe/frames_test.py
##########
@@ -453,6 +453,13 @@ def test_series_getitem(self):
     s.index = s.index.map(float)
     self._run_test(lambda s: s[1.5:6], s)
 
+  def test_series_is_unique(self):
+    s_unique = pd.Series(range(10))
+    s_dupes = pd.Series(i % 4 for i in range(10))

Review comment:
       Done, thanks




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to