forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TST/DOC/BUG: Accommodate OpenPyXL incompatibility
* Detect whether a compatible version is installed * Skip openpyxl unit tests instead of failing * Inhibit registration of `openpyxl` engine in `ExcelWriter` * Raise `UserWarning` * Document limitation as a known issue * Resolve issue pandas-dev#7169
- Loading branch information
Showing
6 changed files
with
51 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
""" | ||
Detect incompatible version of OpenPyXL | ||
GH7169 | ||
""" | ||
|
||
from distutils.version import LooseVersion | ||
|
||
start_ver = '1.6.1' | ||
stop_ver = '2.0.0' | ||
|
||
def is_compat(): | ||
""" | ||
Detect whether the installed version of openpyxl is supported | ||
Returns True/False if openpyxl is installed, None otherwise | ||
""" | ||
try: | ||
import openpyxl | ||
except ImportError: | ||
return None | ||
|
||
ver = LooseVersion(openpyxl.__version__) | ||
if ver < LooseVersion(start_ver) or LooseVersion(stop_ver) <= ver: | ||
return False | ||
|
||
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters