Connect to all listed data sources in preswald.toml
()
| 10 | |
| 11 | |
| 12 | def connect(): |
| 13 | """ |
| 14 | Connect to all listed data sources in preswald.toml |
| 15 | """ |
| 16 | try: |
| 17 | service = PreswaldService.get_instance() |
| 18 | source_names, duckdb_conn = service.data_manager.connect() |
| 19 | logger.info(f"Successfully connected to data sources: {source_names}") |
| 20 | # TODO: bug - getting duplicated if there are multiple clients |
| 21 | return duckdb_conn |
| 22 | except Exception as e: |
| 23 | logger.error(f"Error connecting to datasources: {e}") |
| 24 | |
| 25 | |
| 26 | def query(sql: str, source_name: str) -> pd.DataFrame: |
no test coverage detected