Skip to content

Remove Encoding of values in char** For Labels #27618

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 31 commits into from
Aug 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
648d2b5
with segfaults
WillAyd Jul 26, 2019
37226d7
Merge remote-tracking branch 'upstream/master' into remove-buf-writes
WillAyd Jul 26, 2019
e890578
Works save datetimes
WillAyd Jul 26, 2019
24a585a
Less failures, still not correct dt support
WillAyd Jul 26, 2019
42cc1ec
Removed encoder attributes in encodeLabels
WillAyd Jul 26, 2019
7385fd8
Added docstring
WillAyd Jul 26, 2019
4aca787
whitespace cleanup
WillAyd Jul 26, 2019
bc5e69a
Removed unused headers
WillAyd Jul 26, 2019
d53527f
Moved macro back to vendor c file
WillAyd Jul 26, 2019
eefadfa
Merge remote-tracking branch 'upstream/master' into remove-buf-writes
WillAyd Aug 1, 2019
7b2af9f
Merge remote-tracking branch 'upstream/master' into remove-buf-writes
WillAyd Aug 5, 2019
2e25bef
Working TS conversions
WillAyd Aug 7, 2019
0820f57
Parametrized test
WillAyd Aug 7, 2019
185aa61
Fixed epoch precision issue for labels
WillAyd Aug 7, 2019
221e43d
Parametrized failing test
WillAyd Aug 7, 2019
18d28c8
Parametrized frame test
WillAyd Aug 7, 2019
7a5fc9c
Removed UTC cast for index
WillAyd Aug 7, 2019
ad06e9c
Merge remote-tracking branch 'upstream/master' into remove-buf-writes
WillAyd Aug 7, 2019
3e22820
blackify
WillAyd Aug 7, 2019
2389a33
Added test for timedelta
WillAyd Aug 7, 2019
104d2f2
Added fix for timedelta as label
WillAyd Aug 7, 2019
dbdaed1
Blackify
WillAyd Aug 8, 2019
3ed7979
Comment cleanup and error handling
WillAyd Aug 8, 2019
01ae178
Added test for tuples
WillAyd Aug 8, 2019
0372794
Whatsnew
WillAyd Aug 8, 2019
e15bede
Warnings fixup
WillAyd Aug 8, 2019
d698255
Simplified object construction
WillAyd Aug 8, 2019
d453ed0
Macro for int64 copying
WillAyd Aug 8, 2019
5ab7ecf
Removed unnecessary padding in sprintf
WillAyd Aug 9, 2019
8ea895e
Merge remote-tracking branch 'upstream/master' into remove-buf-writes
WillAyd Aug 23, 2019
439b695
whitespace fixup
WillAyd Aug 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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));\
} \

Copy link
Member

Choose a reason for hiding this comment

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

does it matter that this is moved from the .h file?

Copy link
Member Author

Choose a reason for hiding this comment

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

No this is intentional and matches the ujson source. It essentially reverts part of #17857

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

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