Skip to content
Open
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
4 changes: 4 additions & 0 deletions matlab/src/matlab/featherread.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
filename(1, 1) string {mustBeNonmissing, mustBeNonzeroLengthText}
end

warning("arrow:io:feather:v1:FeatherReadDeprecated", ...
"Reading from Feather V1 files is deprecated. Use arrow.io.ipc.RecordBatchFileReader to read from Feather V2 (Arrow IPC) files.");


typesToCast = [arrow.type.ID.UInt8, ...
arrow.type.ID.UInt16, ...
arrow.type.ID.UInt32, ...
Expand Down
3 changes: 3 additions & 0 deletions matlab/src/matlab/featherwrite.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ function featherwrite(filename, t)
t table
end

warning("arrow:io:feather:v1:FeatherWriteDeprecated", ...
"Writing to Feather V1 files is deprecated. Use arrow.io.ipc.RecordBatchFileWriter to write to Feather V2 (Arrow IPC) files.");

recordBatch = arrow.recordBatch(t);
writer = arrow.internal.io.feather.Writer(filename);
writer.write(recordBatch);
Expand Down
9 changes: 9 additions & 0 deletions matlab/test/arrow/io/feather/tRoundTrip.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
% permissions and limitations under the License.
classdef tRoundTrip < matlab.unittest.TestCase

methods(TestMethodSetup)

function suppressFeatherV1Warnings(testCase)
import matlab.unittest.fixtures.SuppressedWarningsFixture
testCase.applyFixture(SuppressedWarningsFixture("arrow:io:feather:v1:FeatherReadDeprecated"));
end

end

methods(Test)
function Basic(testCase)
import matlab.unittest.fixtures.TemporaryFolderFixture
Expand Down
29 changes: 29 additions & 0 deletions matlab/test/tfeather.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ function setupTempWorkingDirectory(testCase)
import matlab.unittest.fixtures.WorkingFolderFixture;
testCase.applyFixture(WorkingFolderFixture);
end

function suppressFeatherV1Warnings(testCase)
import matlab.unittest.fixtures.SuppressedWarningsFixture
testCase.applyFixture(SuppressedWarningsFixture("arrow:io:feather:v1:FeatherReadDeprecated"));
testCase.applyFixture(SuppressedWarningsFixture("arrow:io:feather:v1:FeatherWriteDeprecated"));
end

end

Expand Down Expand Up @@ -267,6 +273,29 @@ function UnicodeVariableNames(testCase)
testCase.verifyEqual(actualTable, expectedTable);
end

function VerifyFeatherReadDeprecationWarning(testCase)
filename = fullfile(pwd, 'temp.feather');

t = array2table([1, 2, 3]);
featherwrite(filename, t);

warning("on", "arrow:io:feather:v1:FeatherReadDeprecated");
fcn = @() featherread(filename);
testCase.verifyWarning(fcn, "arrow:io:feather:v1:FeatherReadDeprecated")
warning("off", "arrow:io:feather:v1:FeatherReadDeprecated");
end

function VerifyFeatherWriteDeprecationWarning(testCase)
filename = fullfile(pwd, 'temp.feather');

t = array2table([1, 2, 3]);

warning("on", "arrow:io:feather:v1:FeatherWriteDeprecated");
fcn = @() featherwrite(filename, t);
testCase.verifyWarning(fcn, "arrow:io:feather:v1:FeatherWriteDeprecated")
warning("off", "arrow:io:feather:v1:FeatherReadDeprecated");
end

end
end

Expand Down
Loading