Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Remove Excel support from tabular pipeline given build/platform issues introduced

davidmezzettif63307192641
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index cf9545f9..7056588a 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
- python-version: 3.7
+ python-version: 3.6
- uses: actions/setup-java@v1
with:
java-version: 1.8
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 602ee499..c2d48e38 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
- python-version: 3.7
+ python-version: 3.6
- run: pip install mkdocs-material mkdocstrings git+https://github.com/neuml/txtai#egg=txtai[all]
- run: mkdocs gh-deploy --force
\ No newline at end of file
diff --git a/setup.py b/setup.py
index 86808873..af62fd71 100644
--- a/setup.py
+++ b/setup.py
@@ -27,8 +27,7 @@ extras["pipeline"] = [
"onnx>=1.10.1",
"onnxmltools>=1.9.1",
"onnxruntime>=1.8.1",
- "openpyxl>=3.0.9",
- "pandas>=1.3.4",
+ "pandas>=1.1.0",
"sentencepiece>=0.1.91",
"soundfile>=0.10.3.post1",
"tika>=1.24",
diff --git a/src/python/txtai/pipeline/tabular.py b/src/python/txtai/pipeline/tabular.py
index 2aeddb14..4f91e1b8 100644
--- a/src/python/txtai/pipeline/tabular.py
+++ b/src/python/txtai/pipeline/tabular.py
@@ -58,9 +58,7 @@ class Tabular(Pipeline):
_, extension = os.path.splitext(item)
extension = extension.replace(".", "").lower()
- if extension in ["xlsx", "xls"]:
- df = pd.read_excel(item)
- else:
+ if extension == "csv":
df = pd.read_csv(item)
results.append(self.process(df))
diff --git a/test/python/testtabular.py b/test/python/testtabular.py
index f9536963..7dc087b7 100644
--- a/test/python/testtabular.py
+++ b/test/python/testtabular.py
@@ -67,14 +67,3 @@ class TestTabular(unittest.TestCase):
self.assertEqual(uid, 0)
self.assertEqual(text, "This is a test. Describes text in more detail")
-
- def testXLSX(self):
- """
- Tests parsing a XLSX file
- """
-
- rows = self.tabular([Utils.PATH + "/tabular.xlsx"])
- uid, text, _ = rows[0][0]
-
- self.assertEqual(uid, 0)
- self.assertEqual(text, "The first sentence")