title: Python PandaSQL sqldf no such table error, but if manually execute function it will work
body: <p>I have some code in such a way within a .py file let's call A.py:</p>
  <pre><code>from B import create_dummy_df, sqldf_function
  
  a = create_dummy_df()
  
  query = &quot;&quot;&quot;
  select *
  from a
  &quot;&quot;&quot;
  
  b = sqldf_function(query)
  </code></pre>
  <p>Then in another .py file (I use pycharm) let's call B.py, I have the following function defined:</p>
  <pre><code>from pandasql import sqldf
  
  sqldf_function(q: str):
      foo = sqldf(q.lower(), globals())
      return foo
  </code></pre>
  <p>What I don't understand is, if I try to execute A.py file, I get an error saying no such table a, but if I manually highlight and execute sqldf_function definition code block in B.py in console, then come back and try to execute b=sqldf_function(query) in A.py, it'll work. By the way I'm using python virtual environment console for these local executions.</p>
  <p>Thank you all in advance.</p>