Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

1. {data.table} now depends on R 3.5.0 (2018).

2. pydatatable compatibility layer in `fread()` and `fwrite()` has been removed, [#7069](https://github.com/Rdatatable/data.table/issues/7069). Thanks @badasahog for the report and the PR.

### BUG FIXES

1. `fread()` with `skip=0` and `(header=TRUE|FALSE)` no longer skips the first row when it has fewer fields than subsequent rows, [#7463](https://github.com/Rdatatable/data.table/issues/7463). Thanks @emayerhofer for the report and @ben-schwen for the fix.
Expand Down
2 changes: 0 additions & 2 deletions src/fread.c
Original file line number Diff line number Diff line change
Expand Up @@ -2502,10 +2502,8 @@ int freadMain(freadMainArgs _args)
.threadn = me,
.quoteRule = quoteRule,
.stopTeam = &stopTeam,
#ifndef DTPY
.nStringCols = nStringCols,
.nNonStringCols = nNonStringCols
#endif
};
if ((rowSize8 && !ctx.buff8) || (rowSize4 && !ctx.buff4) || (rowSize1 && !ctx.buff1)) {
stopTeam = true;
Expand Down
21 changes: 8 additions & 13 deletions src/fread.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,11 @@
#include <stdlib.h> // size_t
#include <stdbool.h> // bool
#include "myomp.h"
#ifdef DTPY
#include "py_fread.h"
#define ENC2NATIVE(s) (s)
#else
#include "freadR.h"
extern cetype_t ienc;
// R's message functions only take C's char pointer not SEXP, where encoding info can't be stored
// so must convert the error message char to native encoding first in order to correctly display in R
#define ENC2NATIVE(s) translateChar(mkCharCE(s, ienc))
#endif
#include "freadR.h"
extern cetype_t ienc;
// R's message functions only take C's char pointer not SEXP, where encoding info can't be stored
// so must convert the error message char to native encoding first in order to correctly display in R
#define ENC2NATIVE(s) translateChar(mkCharCE(s, ienc))

// Ordered hierarchy of types
// Each of these corresponds to a parser; they must be ordered "preferentially", i.e., if the same
Expand Down Expand Up @@ -177,7 +172,7 @@ typedef struct freadMainArgs
char _padding[1];

// Any additional implementation-specific parameters.
FREAD_MAIN_ARGS_EXTRA_FIELDS
bool oldNoDateTime;

} freadMainArgs;

Expand Down Expand Up @@ -223,8 +218,8 @@ typedef struct ThreadLocalFreadParsingContext

int quoteRule;

// Any additional implementation-specific parameters.
FREAD_PUSH_BUFFERS_EXTRA_FIELDS
int nStringCols;
int nNonStringCols;

} ThreadLocalFreadParsingContext;

Expand Down
7 changes: 0 additions & 7 deletions src/freadR.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@
#include <Rinternals.h>
#include "po.h"

#define FREAD_MAIN_ARGS_EXTRA_FIELDS \
bool oldNoDateTime;

#define FREAD_PUSH_BUFFERS_EXTRA_FIELDS \
int nStringCols; \
int nNonStringCols;

// Before error() [or warning() with options(warn=2)] call freadCleanup() to close mmp and fix :
// http://stackoverflow.com/questions/18597123/fread-data-table-locks-files
// However, msg has to be manually constructed first (rather than simply leaving construction to snprintf inside warning()
Expand Down
22 changes: 9 additions & 13 deletions src/fwrite.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
#ifdef DTPY
#include "py_fread.h"
#else
#ifndef STRICT_R_HEADERS
#define STRICT_R_HEADERS
#endif
#include <R.h>
#include <Rinternals.h> // for SEXP in writeList() prototype
#include "po.h"
#define STOP error
#define DTPRINT Rprintf
static char internal_error_buff[256] __attribute__((unused)); // todo: fix imports such that compiler warns correctly #6468
#define INTERNAL_STOP(...) do {snprintf(internal_error_buff, sizeof(internal_error_buff), __VA_ARGS__); error("%s %s: %s. %s", _("Internal error in"), __func__, internal_error_buff, _("Please report to the data.table issues tracker"));} while (0)
#ifndef STRICT_R_HEADERS
#define STRICT_R_HEADERS
#endif
#include <R.h>
#include <Rinternals.h> // for SEXP in writeList() prototype
#include "po.h"
#define STOP error
#define DTPRINT Rprintf
static char internal_error_buff[256] __attribute__((unused)); // todo: fix imports such that compiler warns correctly #6468
#define INTERNAL_STOP(...) do {snprintf(internal_error_buff, sizeof(internal_error_buff), __VA_ARGS__); error("%s %s: %s. %s", _("Internal error in"), __func__, internal_error_buff, _("Please report to the data.table issues tracker"));} while (0)

typedef void writer_fun_t(const void *, int64_t, char **);

Expand Down
Loading