Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: AttributeError: 'UsedTable' has no attribute 'table' #2887

Closed
1 task done
nfx opened this issue Oct 9, 2024 · 1 comment · Fixed by #2895
Closed
1 task done

[BUG]: AttributeError: 'UsedTable' has no attribute 'table' #2887

nfx opened this issue Oct 9, 2024 · 1 comment · Fixed by #2895
Assignees
Labels
migrate/code Abstract Syntax Trees and other dark magic step/assessment go/uc/upgrade - Assessment Step

Comments

@nfx
Copy link
Collaborator

nfx commented Oct 9, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

assessment fails:
image

Expected Behavior

assessment works

Steps To Reproduce

No response

Cloud

AWS

Operating System

macOS

Version

latest via Databricks CLI

Relevant log output

No response

@nfx nfx added bug step/assessment go/uc/upgrade - Assessment Step migrate/code Abstract Syntax Trees and other dark magic labels Oct 9, 2024
@nfx nfx assigned nfx and unassigned ericvergnaud Oct 9, 2024
@nfx
Copy link
Collaborator Author

nfx commented Oct 9, 2024

most likely it's because UsedTable passed instead of TableInfoNode

@dataclass
class TableInfoNode:
    table: UsedTable
    node: NodeNG

one of those two:
Image

nfx added a commit that referenced this issue Oct 9, 2024
@nfx nfx closed this as completed in #2895 Oct 9, 2024
nfx added a commit that referenced this issue Oct 9, 2024
nfx pushed a commit that referenced this issue Oct 11, 2024
## Changes
PR #2895 introduced a workaround for #2887, although the issue was not
reproduced.

Careful analysis shows that this workaround is not necessary.

Tests were added recently in `test_context.py`.

Running the above tests against v0.39 reproduces the issue:
![Screenshot 2024-10-11 at 12 51
05](https://github.com/user-attachments/assets/66bb546d-7987-41cf-bdd9-e23fc9f2c40e)

However, running the above tests against v0.40 and above does not
reproduce the issue:
![Screenshot 2024-10-11 at 12 53
42](https://github.com/user-attachments/assets/72649f40-cf40-448a-87cf-d69fd765bbf5)

The issue was already fixed in `pyspark.py` by PR #2841 and it is likely
that the bug reporter was running v0.39

This PR:
 - rolls back the workaround from #2895
 - renames TableInfoNode to UsedTableNode for clarity
 
### Linked issues
#2887 

### Functionality
None

### Tests
- [x] manually tested

---------

Co-authored-by: Eric Vergnaud <eric.vergnaud@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
migrate/code Abstract Syntax Trees and other dark magic step/assessment go/uc/upgrade - Assessment Step
Projects
2 participants