Skip to content

Commit

Permalink
fix(ops): ensure that name attribute is always valid for `ops.SelfRef…
Browse files Browse the repository at this point in the history
…erence`
  • Loading branch information
cpcloud committed Jul 31, 2023
1 parent 983e393 commit 9068aca
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ibis/expr/operations/relations.py
Expand Up @@ -362,9 +362,11 @@ def schema(self):
class SelfReference(TableNode):
table = rlz.table

@property
@attribute.default
def name(self) -> str:
return f"{self.table.name}_ref"
if (name := getattr(self.table, "name", None)) is not None:
return f"{name}_ref"
return util.gen_name("self_ref")

@property
def schema(self):
Expand Down

0 comments on commit 9068aca

Please sign in to comment.