mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
feat: support nulls in the csv uploads (#10208)
* Support more table properties for the hive upload Refactor Add tests, and refactor them to be pytest friendly Use lowercase table names Ignore isort * Use sql params Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
This commit is contained in:
@@ -15,12 +15,27 @@
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
"""Contains the logic to create cohesive forms on the explore view"""
|
||||
import json
|
||||
from typing import Any, List, Optional
|
||||
|
||||
from flask_appbuilder.fieldwidgets import BS3TextFieldWidget
|
||||
from wtforms import Field
|
||||
|
||||
|
||||
class JsonListField(Field):
|
||||
widget = BS3TextFieldWidget()
|
||||
data: List[str] = []
|
||||
|
||||
def _value(self) -> str:
|
||||
return json.dumps(self.data)
|
||||
|
||||
def process_formdata(self, valuelist: List[str]) -> None:
|
||||
if valuelist and valuelist[0]:
|
||||
self.data = json.loads(valuelist[0])
|
||||
else:
|
||||
self.data = []
|
||||
|
||||
|
||||
class CommaSeparatedListField(Field):
|
||||
widget = BS3TextFieldWidget()
|
||||
data: List[str] = []
|
||||
|
||||
Reference in New Issue
Block a user