Skip to content

Commit 4a04044

Browse files
author
MarcoGorelli
committed
remove unused variables from parsers.pyx
1 parent 9f0660c commit 4a04044

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

pandas/_libs/parsers.pyx

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
# Copyright (c) 2012, Lambda Foundry, Inc.
22
# See LICENSE for the license
3-
from base64 import decode
43
from collections import defaultdict
54
from csv import (
65
QUOTE_MINIMAL,
76
QUOTE_NONE,
87
QUOTE_NONNUMERIC,
98
)
10-
from errno import ENOENT
11-
import inspect
129
import sys
1310
import time
1411
import warnings
@@ -24,10 +21,7 @@ from pandas.core.arrays import (
2421
)
2522

2623
cimport cython
27-
from cpython.bytes cimport (
28-
PyBytes_AsString,
29-
PyBytes_FromString,
30-
)
24+
from cpython.bytes cimport PyBytes_AsString
3125
from cpython.exc cimport (
3226
PyErr_Fetch,
3327
PyErr_Occurred,
@@ -631,7 +625,7 @@ cdef class TextReader:
631625
cdef:
632626
Py_ssize_t i, start, field_count, passed_count, unnamed_count, level
633627
char *word
634-
str name, old_name
628+
str name
635629
uint64_t hr, data_line = 0
636630
list header = []
637631
set unnamed_cols = set()
@@ -939,7 +933,7 @@ cdef class TextReader:
939933
object name, na_flist, col_dtype = None
940934
bint na_filter = 0
941935
int64_t num_cols
942-
dict result
936+
dict results
943937
bint use_nullable_dtypes
944938

945939
start = self.parser_start
@@ -1461,7 +1455,7 @@ cdef _string_box_utf8(parser_t *parser, int64_t col,
14611455
bint na_filter, kh_str_starts_t *na_hashset,
14621456
const char *encoding_errors):
14631457
cdef:
1464-
int error, na_count = 0
1458+
int na_count = 0
14651459
Py_ssize_t i, lines
14661460
coliter_t it
14671461
const char *word = NULL
@@ -1517,16 +1511,14 @@ cdef _categorical_convert(parser_t *parser, int64_t col,
15171511
"Convert column data into codes, categories"
15181512
cdef:
15191513
int na_count = 0
1520-
Py_ssize_t i, size, lines
1514+
Py_ssize_t i, lines
15211515
coliter_t it
15221516
const char *word = NULL
15231517

15241518
int64_t NA = -1
15251519
int64_t[::1] codes
15261520
int64_t current_category = 0
15271521

1528-
char *errors = "strict"
1529-
15301522
int ret = 0
15311523
kh_str_t *table
15321524
khiter_t k
@@ -1972,7 +1964,6 @@ cdef kh_str_starts_t* kset_from_list(list values) except NULL:
19721964
cdef kh_float64_t* kset_float64_from_list(values) except NULL:
19731965
# caller takes responsibility for freeing the hash table
19741966
cdef:
1975-
khiter_t k
19761967
kh_float64_t *table
19771968
int ret = 0
19781969
float64_t val
@@ -1983,7 +1974,7 @@ cdef kh_float64_t* kset_float64_from_list(values) except NULL:
19831974
for value in values:
19841975
val = float(value)
19851976

1986-
k = kh_put_float64(table, val, &ret)
1977+
kh_put_float64(table, val, &ret)
19871978

19881979
if table.n_buckets <= 128:
19891980
# See reasoning in kset_from_list

0 commit comments

Comments
 (0)