Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into Rt05
Browse files Browse the repository at this point in the history
* upstream/master:
  TST: xfail excel styler tests, xref GH25351 (pandas-dev#25352)
  • Loading branch information
thoo committed Feb 17, 2019
2 parents 4e4f24a + 659e0ca commit 283861f
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 27 deletions.
6 changes: 3 additions & 3 deletions pandas/_libs/src/compat_helper.h
Expand Up @@ -29,8 +29,8 @@ the macro, which restores compat.
#ifndef PYPY_VERSION
# if PY_VERSION_HEX < 0x03070000 && defined(PySlice_GetIndicesEx)
# undef PySlice_GetIndicesEx
# endif
#endif
# endif // PY_VERSION_HEX
#endif // PYPY_VERSION

PANDAS_INLINE int slice_get_indices(PyObject *s,
Py_ssize_t length,
Expand All @@ -44,7 +44,7 @@ PANDAS_INLINE int slice_get_indices(PyObject *s,
#else
return PySlice_GetIndicesEx((PySliceObject *)s, length, start,
stop, step, slicelength);
#endif
#endif // PY_VERSION_HEX
}

#endif // PANDAS__LIBS_SRC_COMPAT_HELPER_H_
4 changes: 2 additions & 2 deletions pandas/_libs/src/inline_helper.h
Expand Up @@ -19,7 +19,7 @@ The full license is in the LICENSE file, distributed with this software.
#define PANDAS_INLINE static inline
#else
#define PANDAS_INLINE
#endif
#endif
#endif // __GNUC__
#endif // PANDAS_INLINE

#endif // PANDAS__LIBS_SRC_INLINE_HELPER_H_
2 changes: 1 addition & 1 deletion pandas/_libs/src/parse_helper.h
Expand Up @@ -30,7 +30,7 @@ int to_double(char *item, double *p_value, char sci, char decimal,
#if PY_VERSION_HEX < 0x02060000
#define PyBytes_Check PyString_Check
#define PyBytes_AS_STRING PyString_AS_STRING
#endif
#endif // PY_VERSION_HEX

int floatify(PyObject *str, double *result, int *maybe_int) {
int status;
Expand Down
4 changes: 2 additions & 2 deletions pandas/_libs/src/parser/io.c
Expand Up @@ -15,7 +15,7 @@ The full license is in the LICENSE file, distributed with this software.

#ifndef O_BINARY
#define O_BINARY 0
#endif /* O_BINARY */
#endif // O_BINARY

/*
On-disk FILE, uncompressed
Expand Down Expand Up @@ -277,4 +277,4 @@ void *buffer_mmap_bytes(void *source, size_t nbytes, size_t *bytes_read,
return NULL;
}

#endif
#endif // HAVE_MMAP
2 changes: 1 addition & 1 deletion pandas/_libs/src/parser/io.h
Expand Up @@ -25,7 +25,7 @@ typedef struct _file_source {

#if !defined(_WIN32) && !defined(HAVE_MMAP)
#define HAVE_MMAP
#endif
#endif // HAVE_MMAP

typedef struct _memory_map {
int fd;
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/src/parser/tokenizer.c
Expand Up @@ -1480,7 +1480,7 @@ int main(int argc, char *argv[]) {

return 0;
}
#endif
#endif // TEST

// ---------------------------------------------------------------------------
// Implementation of xstrtod
Expand Down
4 changes: 2 additions & 2 deletions pandas/_libs/src/parser/tokenizer.h
Expand Up @@ -42,7 +42,7 @@ See LICENSE for the license

#if defined(_MSC_VER)
#define strtoll _strtoi64
#endif
#endif // _MSC_VER

/*
Expand Down Expand Up @@ -75,7 +75,7 @@ See LICENSE for the license
#define TRACE(X) printf X;
#else
#define TRACE(X)
#endif
#endif // VERBOSE

#define PARSER_OUT_OF_MEMORY -1

Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/src/datetime/np_datetime.c
Expand Up @@ -30,7 +30,7 @@ This file is derived from NumPy 1.7. See NUMPY_LICENSE.txt

#if PY_MAJOR_VERSION >= 3
#define PyInt_AsLong PyLong_AsLong
#endif
#endif // PyInt_AsLong

const npy_datetimestruct _NS_MIN_DTS = {
1677, 9, 21, 0, 12, 43, 145225, 0, 0};
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/src/datetime/np_datetime_strings.c
Expand Up @@ -609,7 +609,7 @@ int make_iso_8601_datetime(npy_datetimestruct *dts, char *outstr, int outlen,
tmplen = _snprintf(substr, sublen, "%04" NPY_INT64_FMT, dts->year);
#else
tmplen = snprintf(substr, sublen, "%04" NPY_INT64_FMT, dts->year);
#endif
#endif // _WIN32
/* If it ran out of space or there isn't space for the NULL terminator */
if (tmplen < 0 || tmplen > sublen) {
goto string_too_short;
Expand Down
11 changes: 7 additions & 4 deletions pandas/tests/io/test_excel.py
Expand Up @@ -2413,7 +2413,10 @@ def style(df):
['', '', '']],
index=df.index, columns=df.columns)

def assert_equal_style(cell1, cell2):
def assert_equal_style(cell1, cell2, engine):
if engine in ['xlsxwriter', 'openpyxl']:
pytest.xfail(reason=("GH25351: failing on some attribute "
"comparisons in {}".format(engine)))
# XXX: should find a better way to check equality
assert cell1.alignment.__dict__ == cell2.alignment.__dict__
assert cell1.border.__dict__ == cell2.border.__dict__
Expand Down Expand Up @@ -2457,7 +2460,7 @@ def custom_converter(css):
assert len(col1) == len(col2)
for cell1, cell2 in zip(col1, col2):
assert cell1.value == cell2.value
assert_equal_style(cell1, cell2)
assert_equal_style(cell1, cell2, engine)
n_cells += 1

# ensure iteration actually happened:
Expand Down Expand Up @@ -2515,7 +2518,7 @@ def custom_converter(css):
assert cell1.number_format == 'General'
assert cell2.number_format == '0%'
else:
assert_equal_style(cell1, cell2)
assert_equal_style(cell1, cell2, engine)

assert cell1.value == cell2.value
n_cells += 1
Expand All @@ -2533,7 +2536,7 @@ def custom_converter(css):
assert not cell1.font.bold
assert cell2.font.bold
else:
assert_equal_style(cell1, cell2)
assert_equal_style(cell1, cell2, engine)

assert cell1.value == cell2.value
n_cells += 1
Expand Down
18 changes: 9 additions & 9 deletions pandas/util/move.c
Expand Up @@ -19,15 +19,15 @@ The full license is in the LICENSE file, distributed with this software.

/* in python 3, we cannot intern bytes objects so this is always false */
#define PyString_CHECK_INTERNED(cs) 0
#endif /* !COMPILING_IN_PY2 */
#endif // !COMPILING_IN_PY2

#ifndef Py_TPFLAGS_HAVE_GETCHARBUFFER
#define Py_TPFLAGS_HAVE_GETCHARBUFFER 0
#endif
#endif // Py_TPFLAGS_HAVE_GETCHARBUFFER

#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#endif // Py_TPFLAGS_HAVE_NEWBUFFER

static PyObject *badmove; /* bad move exception class */

Expand Down Expand Up @@ -85,14 +85,14 @@ static PyBufferProcs stolenbuf_as_buffer = {
(getbufferproc) stolenbuf_getbuffer,
};

#else /* Python 3 */
#else // Python 3

static PyBufferProcs stolenbuf_as_buffer = {
(getbufferproc) stolenbuf_getbuffer,
NULL,
};

#endif /* COMPILING_IN_PY2 */
#endif // COMPILING_IN_PY2

PyDoc_STRVAR(stolenbuf_doc,
"A buffer that is wrapping a stolen bytes object's buffer.");
Expand Down Expand Up @@ -208,7 +208,7 @@ static PyModuleDef move_module = {
-1,
methods,
};
#endif /* !COMPILING_IN_PY2 */
#endif // !COMPILING_IN_PY2

PyDoc_STRVAR(
badmove_doc,
Expand All @@ -231,7 +231,7 @@ PyInit__move(void)
#else
#define ERROR_RETURN
init_move(void)
#endif /* !COMPILING_IN_PY2 */
#endif // !COMPILING_IN_PY2
{
PyObject *m;

Expand All @@ -250,7 +250,7 @@ init_move(void)
if (!(m = PyModule_Create(&move_module)))
#else
if (!(m = Py_InitModule(MODULE_NAME, methods)))
#endif /* !COMPILING_IN_PY2 */
#endif // !COMPILING_IN_PY2
{
return ERROR_RETURN;
}
Expand All @@ -269,5 +269,5 @@ init_move(void)

#if !COMPILING_IN_PY2
return m;
#endif /* !COMPILING_IN_PY2 */
#endif // !COMPILING_IN_PY2
}

0 comments on commit 283861f

Please sign in to comment.