remove python fetch
This commit is contained in:
Родитель
8eaf53e529
Коммит
6b3bf8bdd6
|
@ -1,3 +0,0 @@
|
|||
# fetch
|
||||
|
||||
Executes an asynchronous resource request to a specified URL. Currently only HTTP GET is supported, with no additional headers.
|
|
@ -1,24 +0,0 @@
|
|||
#
|
||||
# Copyright (c) Microsoft. All rights reserved.
|
||||
# Licensed under the MIT license. See LICENSE file in the project.
|
||||
#
|
||||
|
||||
from urllib.parse import urlparse
|
||||
|
||||
import pandas as pd
|
||||
|
||||
from datashaper.table_store import TableContainer
|
||||
|
||||
|
||||
__reader_mapping = {
|
||||
"csv": lambda **kwargs: pd.read_csv(
|
||||
kwargs["url"], sep=kwargs["delimiter"], na_values=["undefined"]
|
||||
),
|
||||
"json": lambda **kwargs: pd.read_json(kwargs["url"]),
|
||||
}
|
||||
|
||||
|
||||
def fetch(url: str, delimiter: str = ",", **kwargs):
|
||||
file_type = urlparse(url).path.split(".")[-1]
|
||||
output = __reader_mapping[file_type](**{"url": url, "delimiter": delimiter})
|
||||
return TableContainer(table=output)
|
|
@ -15,7 +15,6 @@ from datashaper.engine.verbs.dedupe import dedupe
|
|||
from datashaper.engine.verbs.derive import derive
|
||||
from datashaper.engine.verbs.difference import difference
|
||||
from datashaper.engine.verbs.erase import erase
|
||||
from datashaper.engine.verbs.fetch import fetch
|
||||
from datashaper.engine.verbs.fill import fill
|
||||
from datashaper.engine.verbs.filter import filter
|
||||
from datashaper.engine.verbs.fold import fold
|
||||
|
@ -56,7 +55,6 @@ functions: Dict[Verb, Callable] = {
|
|||
Verb.Derive: derive,
|
||||
Verb.Difference: difference,
|
||||
Verb.Erase: erase,
|
||||
Verb.Fetch: fetch,
|
||||
Verb.Fill: fill,
|
||||
Verb.Filter: filter,
|
||||
Verb.Fold: fold,
|
||||
|
|
|
@ -24,7 +24,6 @@ class Verb(Enum):
|
|||
Derive = "derive"
|
||||
Difference = "difference"
|
||||
Erase = "erase"
|
||||
Fetch = "fetch"
|
||||
Fill = "fill"
|
||||
Filter = "filter"
|
||||
FilterAggregateLookup = "filter-aggregate-lookup"
|
||||
|
|
Загрузка…
Ссылка в новой задаче