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:
Bogdan
2020-07-06 13:26:43 -07:00
committed by GitHub
parent 318e5347bc
commit 84f8a51458
10 changed files with 325 additions and 160 deletions

View File

@@ -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] = []