superset icon indicating copy to clipboard operation
superset copied to clipboard

How to configure a datasource Extra parameter?

Open lhyundeadsoul opened this issue 7 years ago • 8 comments

Make sure these boxes are checked before submitting your issue - thank you!

  • [x] I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • [x] I have reproduced the issue with at least the latest released version of superset.
  • [x] I have checked the issue tracker for the same issue and I haven't found one similar.

Superset version

0.999.0dev more ./superset/assets/package.json``installed by docker

Expected results

image press save button, engine param can be configered correctly

Actual results

Invalid argument(s) 'pool_size','max_overflow' sent to create_engine(), using configuration PGDialect_psycopg2/NullPool/Engine. Please check that the keyword arguments are appropriate for this combination of components.

Steps to reproduce

  1. go to Edit Database Page
  2. config Extra section
  3. save button

lhyundeadsoul avatar Feb 22 '19 08:02 lhyundeadsoul

Please try wrap arguments by "connect_args"

"engine_params": {"connect_args": {"pool_size": 10: "max_overflow": 20}}

reference from https://docs.sqlalchemy.org/en/latest/core/engines.html?highlight=create_engine#sqlalchemy.create_engine

zhaoyongjie avatar Feb 25 '19 02:02 zhaoyongjie

Please try wrap arguments by "connect_args"

"engine_params": {"connect_args": {"pool_size": 10: "max_overflow": 20}}

reference from https://docs.sqlalchemy.org/en/latest/core/engines.html?highlight=create_engine#sqlalchemy.create_engine

Thanks for help!

But i got a following error

(psycopg2.ProgrammingError) invalid dsn: invalid connection option "pool_size" (Background on this error at: http://sqlalche.me/e/f405)

I have checked the doc out, and i supposed that the "pool_size" and "connect_args" might be in one level ,rather than "pool_size" is underlying the "connect_args"

image image

thank you any way @zhaoyongjie

lhyundeadsoul avatar Feb 25 '19 03:02 lhyundeadsoul

@kristw hey dude, I haven't gotten the answer to this question and why u close this issue?

lhyundeadsoul avatar Mar 17 '19 11:03 lhyundeadsoul

My apology. I misunstood while triaging the issues. Please feel free to reopen if this happens.

kristw avatar Mar 17 '19 19:03 kristw

Here's how it goes: https://github.com/apache/incubator-superset/blob/b5d03c85c578bd12bfb99446a54543bd029361ad/superset/models/core.py#L800-L820

mistercrunch avatar Mar 18 '19 05:03 mistercrunch

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

stale[bot] avatar May 17 '19 06:05 stale[bot]

@lhyundeadsoul were you able to figure this out? I'm having the same issue on Superset v0.35.1.

When I use

"engine_params": {"connect_args": {"pool_size": 10, "max_overflow": 20}}

I get:

(psycopg2.ProgrammingError) invalid dsn: invalid connection option "pool_size" (Background on this error at: http://sqlalche.me/e/f405)

jay-finn avatar Apr 03 '20 05:04 jay-finn

It seems like Superset is using NullPool so pool_size and max_overflow won't work for that.

jay-finn avatar Apr 03 '20 06:04 jay-finn