Skip to content

Commit

Permalink
fix: Add __eq__, __hash__ to SparkSource for comparision
Browse files Browse the repository at this point in the history
Signed-off-by: tanlocnguyen <tanlocnguyen296@gmail.com>
  • Loading branch information
ElliotNguyen68 committed Mar 21, 2024
1 parent 8eb0c59 commit 7f7e4e9
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,22 @@ def get_table_query_string(self) -> str:

return f"`{tmp_table_name}`"

def __eq__(self, other):
base_eq=super().__eq__(other=other)
if not base_eq:
return False
if self.table != other.table:
return False
if self.query != other.query:
return False
if self.path != other.path:
return False

return True

def __hash__(self):
return super().__hash__()


class SparkOptions:
allowed_formats = [format.value for format in SparkSourceFormat]
Expand Down

0 comments on commit 7f7e4e9

Please sign in to comment.