fix: bump Helm chart release version (#18751) (#18758)

Co-authored-by: wiktor2200 <wiktor2200@users.noreply.github.com>
(cherry picked from commit 099421770c)
This commit is contained in:
John Bodley
2022-02-26 07:12:04 +13:00
committed by Ville Brofeldt
parent a76ae2edb6
commit 5b465c2ff1
3 changed files with 17 additions and 37 deletions

View File

@@ -29,7 +29,7 @@ from wtforms import (
StringField, StringField,
) )
from wtforms.ext.sqlalchemy.fields import QuerySelectField from wtforms.ext.sqlalchemy.fields import QuerySelectField
from wtforms.validators import DataRequired, Length, NumberRange, Optional from wtforms.validators import DataRequired, Length, NumberRange, Optional, Regexp
from superset import app, db, security_manager from superset import app, db, security_manager
from superset.forms import ( from superset.forms import (
@@ -94,7 +94,10 @@ class CsvToDatabaseForm(UploadToDatabaseForm):
name = StringField( name = StringField(
_("Table Name"), _("Table Name"),
description=_("Name of table to be created from csv data."), description=_("Name of table to be created from csv data."),
validators=[DataRequired()], validators=[
DataRequired(),
Regexp(r"^[^\.]+$", message=_("Table name cannot contain a schema")),
],
widget=BS3TextFieldWidget(), widget=BS3TextFieldWidget(),
) )
csv_file = FileField( csv_file = FileField(
@@ -245,7 +248,10 @@ class ExcelToDatabaseForm(UploadToDatabaseForm):
name = StringField( name = StringField(
_("Table Name"), _("Table Name"),
description=_("Name of table to be created from excel data."), description=_("Name of table to be created from excel data."),
validators=[DataRequired()], validators=[
DataRequired(),
Regexp(r"^[^\.]+$", message=_("Table name cannot contain a schema")),
],
widget=BS3TextFieldWidget(), widget=BS3TextFieldWidget(),
) )
excel_file = FileField( excel_file = FileField(
@@ -378,7 +384,10 @@ class ColumnarToDatabaseForm(UploadToDatabaseForm):
name = StringField( name = StringField(
_("Table Name"), _("Table Name"),
description=_("Name of table to be created from columnar data."), description=_("Name of table to be created from columnar data."),
validators=[DataRequired()], validators=[
DataRequired(),
Regexp(r"^[^\.]+$", message=_("Table name cannot contain a schema")),
],
widget=BS3TextFieldWidget(), widget=BS3TextFieldWidget(),
) )
columnar_file = MultipleFileField( columnar_file = MultipleFileField(

View File

@@ -142,17 +142,6 @@ class CsvToDatabaseView(SimpleFormView):
flash(message, "danger") flash(message, "danger")
return redirect("/csvtodatabaseview/form") return redirect("/csvtodatabaseview/form")
if "." in csv_table.table and csv_table.schema:
message = _(
"You cannot specify a namespace both in the name of the table: "
'"%(csv_table.table)s" and in the schema field: '
'"%(csv_table.schema)s". Please remove one',
table=csv_table.table,
schema=csv_table.schema,
)
flash(message, "danger")
return redirect("/csvtodatabaseview/form")
try: try:
df = pd.concat( df = pd.concat(
pd.read_csv( pd.read_csv(
@@ -289,17 +278,6 @@ class ExcelToDatabaseView(SimpleFormView):
flash(message, "danger") flash(message, "danger")
return redirect("/exceltodatabaseview/form") return redirect("/exceltodatabaseview/form")
if "." in excel_table.table and excel_table.schema:
message = _(
"You cannot specify a namespace both in the name of the table: "
'"%(excel_table.table)s" and in the schema field: '
'"%(excel_table.schema)s". Please remove one',
table=excel_table.table,
schema=excel_table.schema,
)
flash(message, "danger")
return redirect("/exceltodatabaseview/form")
uploaded_tmp_file_path = tempfile.NamedTemporaryFile( # pylint: disable=consider-using-with uploaded_tmp_file_path = tempfile.NamedTemporaryFile( # pylint: disable=consider-using-with
dir=app.config["UPLOAD_FOLDER"], dir=app.config["UPLOAD_FOLDER"],
suffix=os.path.splitext(form.excel_file.data.filename)[1].lower(), suffix=os.path.splitext(form.excel_file.data.filename)[1].lower(),
@@ -459,17 +437,6 @@ class ColumnarToDatabaseView(SimpleFormView):
flash(message, "danger") flash(message, "danger")
return redirect("/columnartodatabaseview/form") return redirect("/columnartodatabaseview/form")
if "." in columnar_table.table and columnar_table.schema:
message = _(
"You cannot specify a namespace both in the name of the table: "
'"%(columnar_table.table)s" and in the schema field: '
'"%(columnar_table.schema)s". Please remove one',
table=columnar_table.table,
schema=columnar_table.schema,
)
flash(message, "danger")
return redirect("/columnartodatabaseview/form")
try: try:
chunks = [read(file, **kwargs) for file in files] chunks = [read(file, **kwargs) for file in files]
df = pd.concat(chunks) df = pd.concat(chunks)

View File

@@ -219,6 +219,10 @@ def test_import_csv_enforced_schema(mock_event_logger):
full_table_name = f"admin_database.{CSV_UPLOAD_TABLE_W_SCHEMA}" full_table_name = f"admin_database.{CSV_UPLOAD_TABLE_W_SCHEMA}"
# Invalid table name
resp = upload_csv(CSV_FILENAME1, full_table_name)
assert "Table name cannot contain a schema" in resp
# no schema specified, fail upload # no schema specified, fail upload
resp = upload_csv(CSV_FILENAME1, CSV_UPLOAD_TABLE_W_SCHEMA, extra={"schema": None}) resp = upload_csv(CSV_FILENAME1, CSV_UPLOAD_TABLE_W_SCHEMA, extra={"schema": None})
assert ( assert (