I am trying to write a custom dataframe object- CustomFrame that inherits from the DataFrame class of pyspark. This is how it looks like
from pyspark.sql import DataFrame
class CustomFrame(DataFrame):
def __init__(self, spark_df, is_vector=False):
self.is_vector = is_vector
df = CustomFrame(spark.createDataFrame([[1,2],[3,4]], ['a', 'b']))
But when I run the following, df.show(1)
I get a recursion error
RecursionError: maximum recursion depth exceeded
I am not sure what's causing this. I haven't really made any changes to its behavior. Any idea why I am getting this error?