Skip to content

Commit

Permalink
build: pre-commit autoupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
gavindsouza committed Oct 28, 2024
1 parent ef42d60 commit ab1ab99
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
3 changes: 2 additions & 1 deletion .flake8_strict
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ ignore =
F841,
E713,
E712,
B023
B023,
E704,


max-line-length = 200
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ fail_fast: false

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
files: "remote_actions.*"
Expand All @@ -15,7 +15,7 @@ repos:
- id: check-ast

- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
rev: 7.1.0
hooks:
- id: flake8
additional_dependencies: [
Expand All @@ -24,13 +24,13 @@ repos:
args: ['--config', '.flake8_strict']

- repo: https://github.com/timothycrosley/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
exclude: ".*setup.py$"

- repo: https://github.com/psf/black
rev: 23.7.0
rev: 24.10.0
hooks:
- id: black
additional_dependencies: ['click']
12 changes: 4 additions & 8 deletions toolbox/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,19 @@


@click.group("doctype-manager")
def doctype_manager_cli():
...
def doctype_manager_cli(): ...


@click.group("sql-recorder")
def sql_recorder_cli():
...
def sql_recorder_cli(): ...


@click.group("index-manager")
def index_manager_cli():
...
def index_manager_cli(): ...


@click.group("sql-manager")
def sql_manager_cli():
...
def sql_manager_cli(): ...


@click.command("start")
Expand Down
1 change: 1 addition & 0 deletions toolbox/overrides.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def boot_session(bootinfo):
}
}


def after_migrate():
import frappe

Expand Down
1 change: 1 addition & 0 deletions toolbox/sql_recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from re import compile

import frappe

import toolbox

TRACEBACK_PATH_PATTERN = compile(".*/apps/")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import frappe
from frappe import _

from toolbox.api.index_manager import tables


@frappe.whitelist()
def get():
data = tables(limit=10)
labels = [x["name"] for x in data]
datasets = [
{'name': 'Read', 'values': [x["num_read_queries"] for x in data]},
{'name': 'Write', 'values': [x["num_write_queries"] for x in data]},
{"name": "Read", "values": [x["num_read_queries"] for x in data]},
{"name": "Write", "values": [x["num_write_queries"] for x in data]},
]

return {
Expand Down
6 changes: 2 additions & 4 deletions toolbox/toolbox/doctype/mariadb_index/mariadb_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,10 @@ def db_insert(self, *args, **kwargs):
def db_update(self):
raise NotImplementedError

def delete(self):
...
def delete(self): ...

@staticmethod
def get_stats(args):
...
def get_stats(args): ...

def load_from_db(self):
index, column_name, table = self.name.split("--")
Expand Down
4 changes: 3 additions & 1 deletion toolbox/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ def process_sql_metadata_chunk(
try:
explain_data = frappe.db.sql(f"EXPLAIN EXTENDED {query}", as_dict=True)
except Exception as e:
frappe.logger("toolbox").exception(f"process_sql_metadata_chunk: EXPLAIN EXTENDED {query}")
frappe.logger("toolbox").exception(
f"process_sql_metadata_chunk: EXPLAIN EXTENDED {query}"
)
continue

if not explain_data:
Expand Down

0 comments on commit ab1ab99

Please sign in to comment.