Skip to content

Commit

Permalink
Merge branch 'master' into ggplot_hist_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
edublancas authored Jul 16, 2023
2 parents 26a69f3 + c1f9cdf commit 1397e65
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 13 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci-integration-db-live.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ jobs:
python-version: ['3.11']
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}

env:
PLOOMBER_VERSION_CHECK_DISABLED: true

steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci-integration-db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ jobs:
python-version: ['3.11']
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}

env:
PLOOMBER_VERSION_CHECK_DISABLED: true

steps:

- name: Checkout
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ jobs:
needs: [preliminary]
if: needs.preliminary.outputs.check_doc_modified == 'failure'
uses: ./.github/workflows/ci-integration-db.yaml

test:
needs: [preliminary]
if: needs.preliminary.outputs.check_doc_modified == 'failure'
Expand All @@ -91,6 +92,9 @@ jobs:

runs-on: ${{ matrix.os }}

env:
PLOOMBER_VERSION_CHECK_DISABLED: true

steps:

- name: Checkout
Expand Down Expand Up @@ -141,6 +145,9 @@ jobs:

runs-on: ${{ matrix.os }}

env:
PLOOMBER_VERSION_CHECK_DISABLED: true

steps:

- name: Checkout
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* [Fix] Adding `--with` back because of issues with sqlglot query parser (#684)
* [Fix] Improving << parsing logic (#610)
* [Fix] Fixed vertical color breaks in histograms (#702)
* [Fix] Migrate user feedback to use display module (#548)

## 0.7.9 (2023-06-19)

Expand Down
2 changes: 1 addition & 1 deletion src/sql/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ def close_all(cls, verbose=False):
conn.close(key)

if verbose:
print(f"Closing {key}")
display.message(f"Closing {key}")

cls.connections = {}

Expand Down
10 changes: 6 additions & 4 deletions src/sql/magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def __init__(self, shell):
@validate("displaylimit")
def _valid_displaylimit(self, proposal):
if proposal["value"] is None:
print("displaylimit: Value None will be treated as 0 (no limit)")
display.message("displaylimit: Value None will be treated as 0 (no limit)")
return 0
try:
value = int(proposal["value"])
Expand All @@ -188,7 +188,9 @@ def _mutex_autopandas_autopolars(self, change):
other = "autopolars" if change["name"] == "autopandas" else "autopandas"
if getattr(self, other):
setattr(self, other, False)
print(f"Disabled '{other}' since '{change['name']}' was enabled.")
display.message(
f"Disabled '{other}' since '{change['name']}' was enabled."
)

def check_random_arguments(self, line="", cell=""):
# check only for cell magic
Expand Down Expand Up @@ -411,7 +413,7 @@ def interactive_execute_wrapper(**kwargs):
interactive_dict = {}
for key in args.interact:
interactive_dict[key] = local_ns[key]
print(
display.message(
"Interactive mode, please interact with below "
"widget(s) to control the variable"
)
Expand Down Expand Up @@ -527,7 +529,7 @@ def interactive_execute_wrapper(**kwargs):
result = result.dict()

if self.feedback:
print(
display.message(
"Returning data to local variables [{}]".format(", ".join(keys))
)

Expand Down
12 changes: 7 additions & 5 deletions src/sql/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from sql.util import flatten
from sqlalchemy.exc import ProgrammingError
from sql import exceptions
from sql import exceptions, display

try:
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -682,7 +682,7 @@ def _bar(table, column, with_=None, conn=None):
x_ = column[0]
height_ = column[1]

print(f"Removing NULLs, if there exists any from {x_} and {height_}")
display.message(f"Removing NULLs, if there exists any from {x_} and {height_}")
template_ = """
select "{{x_}}" as x,
"{{height_}}" as height
Expand All @@ -701,7 +701,7 @@ def _bar(table, column, with_=None, conn=None):
query = template.render(table=table, x_=x_, height_=height_)

else:
print(f"Removing NULLs, if there exists any from {column}")
display.message(f"Removing NULLs, if there exists any from {column}")
template_ = """
select "{{column}}" as x,
count("{{column}}") as height
Expand Down Expand Up @@ -866,7 +866,9 @@ def _pie(table, column, with_=None, conn=None):
labels_ = column[0]
size_ = column[1]

print(f"Removing NULLs, if there exists any from {labels_} and {size_}")
display.message(
f"Removing NULLs, if there exists any from {labels_} and {size_}"
)
template_ = """
select "{{labels_}}" as labels,
"{{size_}}" as size
Expand All @@ -881,7 +883,7 @@ def _pie(table, column, with_=None, conn=None):
query = template.render(table=table, labels_=labels_, size_=size_)

else:
print(f"Removing NULLs, if there exists any from {column}")
display.message(f"Removing NULLs, if there exists any from {column}")
template_ = """
select "{{column}}" as x,
count("{{column}}") as height
Expand Down
2 changes: 1 addition & 1 deletion src/sql/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ def _commit(conn, config, manual_commit):
with Session(conn.session) as session:
session.commit()
except sqlalchemy.exc.OperationalError:
print("The database does not support the COMMIT command")
display.message("The database does not support the COMMIT command")


def is_postgres_or_redshift(dialect):
Expand Down
4 changes: 2 additions & 2 deletions src/sql/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import difflib
from sql.connection import Connection
from sql.store import store, _get_dependents_for_key
from sql import exceptions
from sql import exceptions, display
import json

SINGLE_QUOTE = "'"
Expand Down Expand Up @@ -182,7 +182,7 @@ def strip_multiple_chars(string: str, chars: str) -> str:

def is_saved_snippet(table: str) -> bool:
if table in list(store):
print(f"Plotting using saved snippet : {table}")
display.message(f"Plotting using saved snippet : {table}")
return True
return False

Expand Down

0 comments on commit 1397e65

Please sign in to comment.