File tree Expand file tree Collapse file tree 2 files changed +20
-22
lines changed
third_party/bigframes_vendored Expand file tree Collapse file tree 2 files changed +20
-22
lines changed Original file line number Diff line number Diff line change 2222import bigframes ._config
2323
2424
25- @pytest .fixture (scope = "session" )
26- def polars_session ():
27- pytest .importorskip ("polars" )
28-
29- from bigframes .testing import polars_session
30-
31- return polars_session .TestSession ()
32-
33-
3425@pytest .fixture (autouse = True )
35- def default_doctest_imports (doctest_namespace , polars_session ):
26+ def default_doctest_imports (doctest_namespace ):
3627 """
3728 Avoid some boilerplate in pandas-inspired tests.
3829
3930 See: https://docs.pytest.org/en/stable/how-to/doctest.html#doctest-namespace-fixture
4031 """
32+ try :
33+ from bigframes .testing import polars_session
34+
35+ bpd = polars_session .TestSession ()
36+ except ImportError :
37+ # Don't skip doctest if polars isn't available.
38+ import bigframes .pandas as bpd # type: ignore
39+
4140 doctest_namespace ["np" ] = np
4241 doctest_namespace ["pd" ] = pd
4342 doctest_namespace ["pa" ] = pa
44- doctest_namespace ["bpd" ] = polars_session
43+ doctest_namespace ["bpd" ] = bpd
4544 bigframes ._config .options .display .progress_bar = None
Original file line number Diff line number Diff line change 2222import bigframes ._config
2323
2424
25- @pytest .fixture (scope = "session" )
26- def polars_session ():
27- pytest .importorskip ("polars" )
28-
29- from bigframes .testing import polars_session
30-
31- return polars_session .TestSession ()
32-
33-
3425@pytest .fixture (autouse = True )
35- def default_doctest_imports (doctest_namespace , polars_session ):
26+ def default_doctest_imports (doctest_namespace ):
3627 """
3728 Avoid some boilerplate in pandas-inspired tests.
3829
3930 See: https://docs.pytest.org/en/stable/how-to/doctest.html#doctest-namespace-fixture
4031 """
32+ try :
33+ from bigframes .testing import polars_session
34+
35+ bpd = polars_session .TestSession ()
36+ except ImportError :
37+ # Don't skip doctest if polars isn't available.
38+ import bigframes .pandas as bpd
39+
4140 doctest_namespace ["np" ] = np
4241 doctest_namespace ["pd" ] = pd
4342 doctest_namespace ["pa" ] = pa
44- doctest_namespace ["bpd" ] = polars_session
43+ doctest_namespace ["bpd" ] = bpd
4544 bigframes ._config .options .display .progress_bar = None
You can’t perform that action at this time.
0 commit comments