Skip to content

Commit

Permalink
Remove Encoding of values in char** For Labels (pandas-dev#27618)
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAyd authored and galuhsahid committed Aug 25, 2019
1 parent 77eadd6 commit 8641797
Show file tree
Hide file tree
Showing 5 changed files with 250 additions and 132 deletions.
1 change: 1 addition & 0 deletions doc/source/whatsnew/v1.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ I/O
^^^

- :meth:`read_csv` now accepts binary mode file buffers when using the Python csv engine (:issue:`23779`)
- Bug in :meth:`DataFrame.to_json` where using a Tuple as a column or index value and using ``orient="columns"`` or ``orient="index"`` would produce invalid JSON (:issue:`20500`)
-

Plotting
Expand Down
7 changes: 0 additions & 7 deletions pandas/_libs/src/ujson/lib/ultrajson.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,4 @@ EXPORTFUNCTION JSOBJ JSON_DecodeObject(JSONObjectDecoder *dec,
const char *buffer, size_t cbBuffer);
EXPORTFUNCTION void encode(JSOBJ, JSONObjectEncoder *, const char *, size_t);

#define Buffer_Reserve(__enc, __len) \
if ((size_t)((__enc)->end - (__enc)->offset) < (size_t)(__len)) { \
Buffer_Realloc((__enc), (__len)); \
}

void Buffer_Realloc(JSONObjectEncoder *enc, size_t cbNeeded);

#endif // PANDAS__LIBS_SRC_UJSON_LIB_ULTRAJSON_H_
6 changes: 6 additions & 0 deletions pandas/_libs/src/ujson/lib/ultrajsonenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,12 @@ int Buffer_EscapeStringValidated(JSOBJ obj, JSONObjectEncoder *enc,
}
}

#define Buffer_Reserve(__enc, __len) \
if ( (size_t) ((__enc)->end - (__enc)->offset) < (size_t) (__len)) \
{ \
Buffer_Realloc((__enc), (__len));\
} \

#define Buffer_AppendCharUnchecked(__enc, __chr) *((__enc)->offset++) = __chr;

FASTCALL_ATTR INLINE_PREFIX void FASTCALL_MSVC strreverse(char *begin,
Expand Down
Loading

0 comments on commit 8641797

Please sign in to comment.