-
Notifications
You must be signed in to change notification settings - Fork 30
fix: redshift execute dynamic query #264
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
base: develop
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -22,32 +22,41 @@ async def test_connection(self) -> bool: | |
| return await asyncio.to_thread(self.client.test_connection) | ||
|
|
||
| def get_schema(self) -> dict: | ||
| return self.client.get_table_info() | ||
| table_names = self.client.list_tables() | ||
| return { | ||
| table_name: self.client.get_table_info(table_name) | ||
| for table_name in table_names | ||
| } | ||
|
Comment on lines
24
to
+29
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. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Search for get_schema calls that pass arguments
rg -n 'get_schema\s*\(' --type=py -C2 | grep -v 'def get_schema'Repository: rootflo/wavefront Length of output: 2781 🏁 Script executed: # Check the abstract method signature in types.py
cat -n wavefront/server/plugins/datasource/datasource/types.py | sed -n '56,65p'Repository: rootflo/wavefront Length of output: 307 🏁 Script executed: # Check BigQuery plugin's get_schema implementation
cat -n wavefront/server/plugins/datasource/datasource/bigquery/__init__.py | sed -n '20,35p'Repository: rootflo/wavefront Length of output: 683 🏁 Script executed: # Check full context of bigquery_tools.py around line 47
cat -n wavefront/server/modules/tools_module/tools_module/datasources/bigquery_tools.py | sed -n '40,55p'Repository: rootflo/wavefront Length of output: 862 🏁 Script executed: # Search for all get_schema method implementations
rg -n 'def get_schema' --type=py -A3Repository: rootflo/wavefront Length of output: 1636 API signature mismatch: The abstract method 🤖 Prompt for AI Agents |
||
|
|
||
| def get_table_names(self, **kwargs) -> list[str]: | ||
| return self.client.list_tables() | ||
|
|
||
| def fetch_data( | ||
| self, | ||
| table_names: List[str], | ||
| projection: str = '*', | ||
| where_clause: str = 'true', | ||
| projection: Optional[str] = '*', | ||
| where_clause: Optional[str] = 'true', | ||
| join_query: Optional[str] = None, | ||
| params: Optional[Dict[str, Any]] = None, | ||
| offset: int = 0, | ||
| limit: int = 10, | ||
| offset: Optional[int] = 0, | ||
| limit: Optional[int] = 10, | ||
| order_by: Optional[str] = None, | ||
| group_by: Optional[str] = None, | ||
| ) -> List[Dict[str, Any]]: | ||
| projection_value = projection or '*' | ||
| where_clause_value = where_clause or 'true' | ||
| limit_value = limit if limit is not None else 10 | ||
| offset_value = offset if offset is not None else 0 | ||
|
|
||
| return self.client.execute_query_to_dict( | ||
| projection=projection, | ||
| projection=projection_value, | ||
| table_prefix=f'{self.db_name}.', | ||
| table_names=table_names, | ||
| where_clause=where_clause, | ||
| where_clause=where_clause_value, | ||
| join_query=join_query, | ||
| params=params, | ||
| limit=limit, | ||
| offset=offset, | ||
| limit=limit_value, | ||
| offset=offset_value, | ||
| order_by=order_by, | ||
| group_by=group_by, | ||
| ) | ||
|
|
||
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.
🧩 Analysis chain
🏁 Script executed:
Repository: rootflo/wavefront
Length of output: 426
🏁 Script executed:
Repository: rootflo/wavefront
Length of output: 960
Breaking change:
get_schema()will crashbigquery_tools.pycaller.The method signature changed from accepting a
table_idparameter to taking no arguments. The caller at line 47 ofbigquery_tools.pyinvokesplugin.get_schema(table_id), which will raiseTypeError: get_schema() takes 1 positional argument but 2 were given.Additionally, the return value changed fundamentally: the new implementation returns a dict mapping all table IDs in the dataset to their schemas (
{table_id: schema, ...}), while the caller expects a single schema object. Line 55 concatenatesstr(schema_info), which would stringify the entire dict of all schemas instead of a single schema.🤖 Prompt for AI Agents