forked from pool/python-sqlglot
- Add missing-duckdb.patch until we package duckdb as well.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sqlglot?expand=0&rev=3
This commit is contained in:
50
missing-duckdb.patch
Normal file
50
missing-duckdb.patch
Normal file
@@ -0,0 +1,50 @@
|
||||
---
|
||||
tests/test_executor.py | 7 ++++++-
|
||||
tests/test_optimizer.py | 7 ++++++-
|
||||
2 files changed, 12 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/tests/test_executor.py
|
||||
+++ b/tests/test_executor.py
|
||||
@@ -1,6 +1,10 @@
|
||||
import unittest
|
||||
|
||||
-import duckdb
|
||||
+try:
|
||||
+ import duckdb
|
||||
+ DUCKDB_AVAILABLE = True
|
||||
+except ImportError:
|
||||
+ DUCKDB_AVAILABLE = False
|
||||
import pandas as pd
|
||||
from pandas.testing import assert_frame_equal
|
||||
|
||||
@@ -12,6 +16,7 @@ from tests.helpers import FIXTURES_DIR,
|
||||
DIR = FIXTURES_DIR + "/optimizer/tpc-h/"
|
||||
|
||||
|
||||
+@unittest.skipUnless(DUCKDB_AVAILABLE, "Cannot work without duckdb.")
|
||||
class TestExecutor(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
--- a/tests/test_optimizer.py
|
||||
+++ b/tests/test_optimizer.py
|
||||
@@ -1,7 +1,11 @@
|
||||
import unittest
|
||||
from functools import partial
|
||||
|
||||
-import duckdb
|
||||
+try:
|
||||
+ import duckdb
|
||||
+ DUCKDB_AVAILABLE = True
|
||||
+except ImportError:
|
||||
+ DUCKDB_AVAILABLE = False
|
||||
from pandas.testing import assert_frame_equal
|
||||
|
||||
import sqlglot
|
||||
@@ -18,6 +22,7 @@ from tests.helpers import (
|
||||
)
|
||||
|
||||
|
||||
+@unittest.skipUnless(DUCKDB_AVAILABLE, "Cannot work without duckdb.")
|
||||
class TestOptimizer(unittest.TestCase):
|
||||
maxDiff = None
|
||||
|
Reference in New Issue
Block a user