File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import os
66import re
77import sys
8- from typing import Optional , Sequence
8+ from typing import Optional , Sequence , Union
99
1010import cwms
1111import pandas as pd
1212import requests
1313
14- from cwmscli .utils import get_api_key
14+ from cwmscli .utils import get_api_key , has_invalid_chars
1515from cwmscli .utils .deps import requires
1616
1717# used to rebuild data URL for images
2727 "link" : "https://docs.python.org/3/library/imghdr.html" ,
2828 }
2929)
30- def _determine_ext (data : bytes | str , write_type : str ) -> str :
30+ def _determine_ext (data : Union [ bytes , str ] , write_type : str ) -> str :
3131 """
3232 Attempt to determine the file extension from the data itself.
3333 Requires the imghdr module (lazy import) to inspect the bytes for image types.
@@ -51,7 +51,7 @@ def _determine_ext(data: bytes | str, write_type: str) -> str:
5151def _save_base64 (
5252 b64_or_dataurl : str ,
5353 dest : str ,
54- media_type_hint : str | None = None ,
54+ media_type_hint : Optional [ str ] = None ,
5555) -> str :
5656 m = DATA_URL_RE .match (b64_or_dataurl .strip ())
5757 if m :
You can’t perform that action at this time.
0 commit comments