This repository has been archived by the owner on Nov 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix segment configuration heatmap (#777)
* Refactor update segment configuration * Adjust endpoint to work better with frontend * Adjust frontend * Add explicit hover text * handle case when no data is avaiable * Adjust sql query * Adjust query * Fix linting errors * Improce doc strings * Adjust heatmap y axis * Fix e2e test * Set automargin for x axis to prevent overlapping * remove pydocstyle ini * extract execute sql to separate job * Implement feedback * Add gap between cells in heatmap * remove zero line * Fix liniting errors * Improve code documentation * Fix typo * Rmove d ticks * Adjust heat labels * Add Chunk ID to hovertemplate * handle non existing chunks
- Loading branch information
1 parent
27948e1
commit 8c57dd6
Showing
10 changed files
with
334 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from hyrisecockpit.database_manager.cursor import ConnectionFactory | ||
from psycopg2 import DatabaseError, InterfaceError | ||
|
||
|
||
def execute_sql(sql: str, connection_factory: ConnectionFactory): | ||
"""Execute sql on hyrise. | ||
This function executes a sql query via a psycopg2 cursor in a hyrise. If an error occurs | ||
in the hyrise, the methods returns an empty list. This is a very light error handling | ||
to make sure the cockpit is still running even when the hyrise is not responsive for | ||
a moment. | ||
Args: | ||
sql (str): SQL query that should be executed in the hyrise database. | ||
connection_factory (ConnectionFactory): A factory that returns a wrapper object around a psycopg2 | ||
cursor that is connected to the hyrise database. All the attributes needed | ||
to connect to the hyrise are already defined inside the factory. | ||
""" | ||
|
||
try: | ||
with connection_factory.create_cursor() as cur: | ||
cur.execute(sql, None) | ||
return cur.fetchall() | ||
except (DatabaseError, InterfaceError): | ||
return [] |
117 changes: 70 additions & 47 deletions
117
hyrisecockpit/database_manager/job/update_segment_configuration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.