From dbfc2aead80724f723780ca903b68368740b2eb0 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Fri, 29 Mar 2024 11:26:40 +0800 Subject: [PATCH] Improve type hints --- pygmt/datatypes/dataset.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pygmt/datatypes/dataset.py b/pygmt/datatypes/dataset.py index 6b45e001556..ae402270cb9 100644 --- a/pygmt/datatypes/dataset.py +++ b/pygmt/datatypes/dataset.py @@ -3,7 +3,8 @@ """ import ctypes as ctp -from typing import ClassVar +from collections.abc import Mapping +from typing import Any, ClassVar import numpy as np import pandas as pd @@ -145,8 +146,8 @@ class _GMT_DATASEGMENT(ctp.Structure): # noqa: N801 def to_dataframe( self, - column_names: list[str] | None = None, - dtype: type | dict[str, type] | None = None, + column_names: pd.Index | None = None, + dtype: type | Mapping[Any, type] | None = None, index_col: str | int | None = None, ) -> pd.DataFrame: """