Skip to content

DOC: Fix flake8 issue in whatsnew files #24177

Closed
@saurav2608

Description

@saurav2608

In some of the whatsnew files we are using implicit imports. For example in "whatsnew/v0.11.0.rst"
we import pandas from pandas import * implicitly. We instantiate using the implicitly imported class DataFrame later in the code.

df1 = DataFrame(randn(8, 1), columns = ['A'], dtype = 'float32')
df1

The preferred approach is to use explicit import as import pandas as pd and replace the call to DataFrame with pd.DateFrame.

Note:

  1. import pandas as pd is part of the header, so it is imported by default. In that case just replacing DataFrame with pd.DateFrame and removing from pandas import * should be enough.
  2. Many whatnew files are using the preferred approach of explicit calling pd.*. However, the import statement of from pandas import * is included by default. In such case, just remove the import statement.

cc: @datapythonista

Status of whatsnew files

File Name Implicit Imports Flake8-rst
v0.24.0.rst Pass Pass: #24217
v0.23.4.rst Pass Pass
v0.23.3.rst Pass Pass #24273
v0.23.2.rst Pass Pass
v0.23.1.rst Pass: #24199 Pass #24273
v0.23.0.rst Pass Pass: #24217
v0.22.0.rst Pass Pass: #24217
v0.21.1.rst Pass Pass
v0.21.0.rst Pass Pass: #24217
v0.20.3.rst Pass Pass
v0.20.2.rst Pass Pass
v0.20.0.rst Pass Pass: #24236
v0.19.2.rst Pass Pass
v0.19.1.rst Pass Pass
v0.19.0.rst Pass #24236 Pass #24236
v0.18.1.rst Pass Pass
v0.18.0.rst Pass #24233 Pass #24233
v0.17.1.rst Pass #24235 Pass #24235
v0.17.0.rst Pass #24235 Pass #24235
v0.16.2.rst Pass #24338 Pass #24338
v0.16.1.rst Pass #24338 Pass #24338
v0.16.0.rst Pass #24338 Pass #24338
v0.15.2.rst Pass #24635 Pass #24635
v0.15.1.rst Pass #24635 Pass #24635
v0.15.0.rst Pass #24635 Pass #24635
v0.14.1.rst Pass #24253 Pass #24253
v0.14.0.rst Pass #24253 Pass #24253
v0.13.1.rst Pass #24322 Pass #24322
v0.13.0.rst Pass #24322 Pass #24322
v0.12.0.rst Pass #24309 Pass #24309
v0.11.0.rst Pass #24277 Pass #24277
v0.10.1.rst Pass #24277 Pass #24277
v0.10.0.rst Pass #24277 Pass #24277
v0.7*-v0.9* Pass #24273 Pass #24273
v0.4*-v0.6* Pass Pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions