Skip to content

Commit

Permalink
Catch ValueError on index type conversion for pandas 2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
larsevj committed Dec 1, 2023
1 parent b772cc3 commit bda8406
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
install_requires=[
"dash-bootstrap-components",
"dash-daq",
"pandas<2",
"pandas",
"requests",
"webviz-config>=0.0.40",
"webviz-config-equinor",
Expand Down
12 changes: 6 additions & 6 deletions webviz_ert/data_loader/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from typing import Any, Mapping, Optional, List, MutableMapping, Tuple, Dict
from collections import defaultdict
import requests
import io
import logging
from collections import defaultdict
from typing import Any, Dict, List, Mapping, MutableMapping, Optional, Tuple

import pandas as pd
import io
import requests

logger = logging.getLogger()

Expand Down Expand Up @@ -194,10 +195,9 @@ def get_ensemble_record_data(
except DataLoaderException as e:
logger.error(e)
return pd.DataFrame()

try:
df.index = df.index.astype(int)
except TypeError:
except (TypeError, ValueError):
try:
df.index = df.index.map(pd.Timestamp)
except ValueError:
Expand Down

0 comments on commit bda8406

Please sign in to comment.