Skip to content

Commit 8545c0d

Browse files
committed
future annotations
1 parent 84b3f91 commit 8545c0d

File tree

130 files changed

+271
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+271
-0
lines changed

.pre-commit-config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,19 @@ repos:
156156
|(pd|pandas)\.api\.types\.
157157
files: ^pandas/tests/
158158
types_or: [python, cython, rst]
159+
- id: future-annotations
160+
name: Use from __future__ import annotations in source code
161+
language: pygrep
162+
entry: from __future__ import annotations
163+
files: ^pandas/
164+
exclude: |
165+
(?x)
166+
__init__
167+
|^pandas/tests/
168+
|pandas/io/formats/_color_data\.py
169+
|pandas/io/sas/sas_constants\.py
170+
args: [--negate]
171+
types: [python]
159172
- id: pip-to-conda
160173
name: Generate pip dependency from conda
161174
description: This hook checks if the conda environment.yml and requirements-dev.txt are equal

pandas/_config/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
4949
"""
5050

51+
from __future__ import annotations
52+
5153
from collections import namedtuple
5254
from contextlib import (
5355
ContextDecorator,

pandas/_config/dates.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""
22
config for datetime formatting
33
"""
4+
from __future__ import annotations
5+
46
from pandas._config import config as cf
57

68
pc_date_dayfirst_doc = """

pandas/_config/display.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Unopinionated display configuration.
33
"""
44

5+
from __future__ import annotations
6+
57
import locale
68
import sys
79
from typing import Optional

pandas/_config/localization.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
44
Name `localization` is chosen to avoid overlap with builtin `locale` module.
55
"""
6+
from __future__ import annotations
7+
68
from contextlib import contextmanager
79
import locale
810
import re

pandas/_testing/_io.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import bz2
24
from functools import wraps
35
import gzip

pandas/_testing/_random.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import string
24

35
import numpy as np

pandas/_testing/_warnings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from contextlib import contextmanager
24
import re
35
from typing import (

pandas/_testing/asserters.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from typing import (
24
Union,
35
cast,

pandas/_testing/compat.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Helpers for sharing tests between DataFrame/Series
33
"""
44

5+
from __future__ import annotations
6+
57
from pandas import DataFrame
68

79

0 commit comments

Comments
 (0)