Skip to content

Commit

Permalink
fix: Add __eq__, __hash__ to SparkSource for correct comparison (#4028)
Browse files Browse the repository at this point in the history
* feat: Enable Arrow-based columnar data transfers

Signed-off-by: tanlocnguyen <tanlocnguyen296@gmail.com>

* fix: Add __eq__, __hash__ to SparkSource for comparision

Signed-off-by: tanlocnguyen <tanlocnguyen296@gmail.com>

* chore: simplify the logic

Signed-off-by: tanlocnguyen <tanlocnguyen296@gmail.com>

---------

Signed-off-by: tanlocnguyen <tanlocnguyen296@gmail.com>
Co-authored-by: tanlocnguyen <tanlocnguyen296@gmail.com>
  • Loading branch information
ElliotNguyen68 and ElliotNguyen68 authored Mar 26, 2024
1 parent 9b98eaf commit e703b40
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,19 @@ def get_table_query_string(self) -> str:

return f"`{tmp_table_name}`"

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

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


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

0 comments on commit e703b40

Please sign in to comment.