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

sqlite beam_nuggets.io.relational_db_api.SqlAlchemyDbException: #40

Open
chckctck3 opened this issue May 10, 2021 · 0 comments
Open

sqlite beam_nuggets.io.relational_db_api.SqlAlchemyDbException: #40

chckctck3 opened this issue May 10, 2021 · 0 comments

Comments

@chckctck3
Copy link

I am running the following simple python script:

import apache_beam as beam
from apache_beam.options.pipeline_options import PipelineOptions
from beam_nuggets.io import relational_db

with beam.Pipeline(options=PipelineOptions()) as p:
source_config = relational_db.SourceConfiguration(
drivername='sqlite',
database='/sqlite/dbs/chinook'
)

print(source_config.url)

records = p | "Reading records from db" >> relational_db.ReadFromDB(
        source_config=source_config,
        table_name='customers',
        query='select * from customers'  # optional. When omitted, all table records are returned.
    )

records | 'Writing to stdout' >> beam.Map(print)

I receive this error, what am I doing wrong??

C:\Users\chuck.brooks\Miniconda3\envs\base38\python.exe C:/PycharmProjects/base38/beam_nuggets_test.py
sqlite:////sqlite/dbs/chinook
Traceback (most recent call last):
File "apache_beam\runners\common.py", line 1233, in apache_beam.runners.common.DoFnRunner.process
File "apache_beam\runners\common.py", line 581, in apache_beam.runners.common.SimpleInvoker.invoke_process
File "apache_beam\runners\common.py", line 1368, in apache_beam.runners.common._OutputProcessor.process_outputs
File "C:\Users\chuck.brooks\Miniconda3\envs\base38\lib\site-packages\beam_nuggets\io\relational_db.py", line 96, in process
for record in db.query(table_name, query):
File "C:\Users\chuck.brooks\Miniconda3\envs\base38\lib\site-packages\beam_nuggets\io\relational_db_api.py", line 272, in query
table = self._open_table_for_read(table_name)
File "C:\Users\chuck.brooks\Miniconda3\envs\base38\lib\site-packages\beam_nuggets\io\relational_db_api.py", line 305, in _open_table_for_read
return self._open_table(
File "C:\Users\chuck.brooks\Miniconda3\envs\base38\lib\site-packages\beam_nuggets\io\relational_db_api.py", line 322, in _open_table
self._get_table(name, get_table_f, **get_table_f_params)
File "C:\Users\chuck.brooks\Miniconda3\envs\base38\lib\site-packages\beam_nuggets\io\relational_db_api.py", line 332, in _get_table
raise SqlAlchemyDbException('Failed to get table {}'.format(name))
beam_nuggets.io.relational_db_api.SqlAlchemyDbException: Failed to get table customers

During handling of the above exception, another exception occurred:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant