-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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: 'function' object has no attribute 'currentframe' #48736
Changes from 4 commits
b4e97f7
c59c8c2
8d8da1d
cf671ec
df5024c
b780065
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1357,10 +1357,17 @@ def test_not_reflect_all_tables(self): | |
|
||
def test_warning_case_insensitive_table_name(self, test_frame1): | ||
# see gh-7815 | ||
# | ||
# We can't test that this warning is triggered, a the database | ||
# configuration would have to be altered. But here we test that | ||
# the warning is certainly NOT triggered in a normal case. | ||
Comment on lines
-1361
to
-1363
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jorisvandenbossche since there is This text was added in https://github.com/pandas-dev/pandas/pull/8180/files There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's from a long time ago ;) Yes, we can certainly test the helper method to raise the warning (as you did now), that's useful to add, but strictly speaking that's still not a 100% guarantee that it will work in practice, as it doesn't ensure we call this helper method (we could accidentally remove that in a refactor). |
||
with tm.assert_produces_warning( | ||
UserWarning, | ||
match=( | ||
r"The provided table name 'TABLE1' is not found exactly as such in " | ||
r"the database after writing the table, possibly due to case " | ||
r"sensitivity issues. Consider using lower case table names." | ||
), | ||
): | ||
sql.SQLDatabase(self.conn).check_case_sensitive("TABLE1", "") | ||
|
||
# Test that the warning is certainly NOT triggered in a normal case. | ||
with tm.assert_produces_warning(None): | ||
test_frame1.to_sql("CaseSensitive", self.conn) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a need to use
import_optional_dependency
here? (I would assume that if you get at this point without having sqlalchemy installed, you already got an error about that earlier? eg the init of this class also imports from sqlalchemy)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed, no need, might as well just import with an alias