Skip to content

CLN: String formatting % -> f-strings #29518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Nov 18, 2019
Prev Previous commit
Next Next commit
Run black format
  • Loading branch information
alimcmaster1 committed Nov 14, 2019
commit 4af85bb10c41fa2e4c5aa900ff8c8887509ed4c5
12 changes: 6 additions & 6 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2083,7 +2083,7 @@ def to_stata(
data_label=data_label,
write_index=write_index,
variable_labels=variable_labels,
**kwargs
**kwargs,
)
writer.write_file()

Expand All @@ -2107,7 +2107,7 @@ def to_parquet(
compression="snappy",
index=None,
partition_cols=None,
**kwargs
**kwargs,
):
"""
Write a DataFrame to the binary parquet format.
Expand Down Expand Up @@ -2187,7 +2187,7 @@ def to_parquet(
compression=compression,
index=index,
partition_cols=partition_cols,
**kwargs
**kwargs,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a black version thing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weirdly using 19.3b0 locally seems to add this for me - I've reverted

Copy link
Member Author

@alimcmaster1 alimcmaster1 Nov 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Black code check in CI fail without this - i've added this back in

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I find this quite odd that you have to add a comma at the end.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to this - #29607

)

@Substitution(
Expand Down Expand Up @@ -4129,7 +4129,7 @@ def fillna(
inplace=False,
limit=None,
downcast=None,
**kwargs
**kwargs,
):
return super().fillna(
value=value,
Expand All @@ -4138,7 +4138,7 @@ def fillna(
inplace=inplace,
limit=limit,
downcast=downcast,
**kwargs
**kwargs,
)

@Appender(_shared_docs["replace"] % _shared_doc_kwargs)
Expand Down Expand Up @@ -6584,7 +6584,7 @@ def _gotitem(
see_also=_agg_summary_and_see_also_doc,
examples=_agg_examples_doc,
versionadded="\n.. versionadded:: 0.20.0\n",
**_shared_doc_kwargs
**_shared_doc_kwargs,
)
@Appender(_shared_docs["aggregate"])
def aggregate(self, func, axis=0, *args, **kwargs):
Expand Down
12 changes: 6 additions & 6 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2059,7 +2059,7 @@ def __getstate__(self):
_typ=self._typ,
_metadata=self._metadata,
attrs=self.attrs,
**meta
**meta,
)

def __setstate__(self, state):
Expand Down Expand Up @@ -7053,7 +7053,7 @@ def interpolate(
limit_direction="forward",
limit_area=None,
downcast=None,
**kwargs
**kwargs,
):
"""
Interpolate values according to different methods.
Expand Down Expand Up @@ -7127,7 +7127,7 @@ def interpolate(
limit_area=limit_area,
inplace=inplace,
downcast=downcast,
**kwargs
**kwargs,
)

if inplace:
Expand Down Expand Up @@ -7827,7 +7827,7 @@ def groupby(
group_keys=True,
squeeze=False,
observed=False,
**kwargs
**kwargs,
):
"""
Group DataFrame or Series using a mapper or by a Series of columns.
Expand Down Expand Up @@ -7953,7 +7953,7 @@ def groupby(
group_keys=group_keys,
squeeze=squeeze,
observed=observed,
**kwargs
**kwargs,
)

def asfreq(self, freq, method=None, how=None, normalize=False, fill_value=None):
Expand Down Expand Up @@ -11580,7 +11580,7 @@ def stat_func(
level=None,
numeric_only=None,
min_count=0,
**kwargs
**kwargs,
):
if name == "sum":
nv.validate_sum(tuple(), kwargs)
Expand Down
8 changes: 4 additions & 4 deletions pandas/core/indexes/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1422,7 +1422,7 @@ def date_range(
normalize=False,
name=None,
closed=None,
**kwargs
**kwargs,
):
"""
Return a fixed frequency DatetimeIndex.
Expand Down Expand Up @@ -1572,7 +1572,7 @@ def date_range(
tz=tz,
normalize=normalize,
closed=closed,
**kwargs
**kwargs,
)
return DatetimeIndex._simple_new(dtarr, tz=dtarr.tz, freq=dtarr.freq, name=name)

Expand All @@ -1588,7 +1588,7 @@ def bdate_range(
weekmask=None,
holidays=None,
closed=None,
**kwargs
**kwargs,
):
"""
Return a fixed frequency DatetimeIndex, with business day as the default
Expand Down Expand Up @@ -1681,7 +1681,7 @@ def bdate_range(
normalize=normalize,
name=name,
closed=closed,
**kwargs
**kwargs,
)


Expand Down
8 changes: 4 additions & 4 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -3796,7 +3796,7 @@ def _gotitem(self, key, ndim, subset=None):
see_also=_agg_see_also_doc,
examples=_agg_examples_doc,
versionadded="\n.. versionadded:: 0.20.0\n",
**_shared_doc_kwargs
**_shared_doc_kwargs,
)
@Appender(generic._shared_docs["aggregate"])
def aggregate(self, func, axis=0, *args, **kwargs):
Expand Down Expand Up @@ -4020,7 +4020,7 @@ def _reduce(
skipna=skipna,
numeric_only=numeric_only,
filter_type=filter_type,
**kwds
**kwds,
)

def _reindex_indexer(self, new_index, indexer, copy):
Expand Down Expand Up @@ -4257,7 +4257,7 @@ def fillna(
inplace=False,
limit=None,
downcast=None,
**kwargs
**kwargs,
):
return super().fillna(
value=value,
Expand All @@ -4266,7 +4266,7 @@ def fillna(
inplace=inplace,
limit=limit,
downcast=downcast,
**kwargs
**kwargs,
)

@Appender(generic._shared_docs["replace"] % _shared_doc_kwargs)
Expand Down