petern48 commented on code in PR #2145:
URL: https://github.com/apache/sedona/pull/2145#discussion_r2226273069


##########
python/tests/geopandas/test_match_geopandas_series.py:
##########
@@ -101,35 +106,35 @@ def setup_method(self):
             )
         ]
 
-        # (sql_table_name, geom)
         self.geoms = [
-            ("points", self.points),
-            ("multipoints", self.multipoints),
-            ("linestrings", self.linestrings),
-            ("multilinestrings", self.multilinestrings),
-            ("polygons", self.polygons),
-            ("multipolygons", self.multipolygons),
-            ("geomcollection", self.geomcollection),
+            self.points,
+            self.multipoints,
+            self.linestrings,
+            self.linearrings,
+            self.multilinestrings,
+            self.polygons,
+            self.multipolygons,
+            self.geomcollection,
         ]
 
-        # create the tables in sedona spark
-        for i, (table_name, geoms) in enumerate(self.geoms):
-            wkt_string = [g.wkt for g in geoms]
-            pd_df = pd.DataFrame({"id": i, "geometry": wkt_string})
-            spark_df = self.spark.createDataFrame(pd_df)
-            spark_df.createOrReplaceTempView(table_name)
+        self.pairs = [
+            (self.points, self.multipolygons),
+            (self.geomcollection, self.polygons),
+            (self.linestrings, self.multipoints),
+            (self.linearrings, self.multilinestrings),
+        ]

Review Comment:
   The main change is this to loop through self.pairs instead of doing the 
double nested loop below. I think self.pairs here is exhaustive enough. This 
cuts test execution down by a lot for all of the predicate tests (e.g 
interesection)
   
   ```
   for geom in self.geoms:
       for geom2 in self.geoms:
   ```



-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to