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
1 change: 1 addition & 0 deletions dist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ version = 0.014
Thrift = 0
Moo = 0
Class::Accessor = 0
Scalar::Util = 0

[PodWeaver]

Expand Down
9 changes: 5 additions & 4 deletions lib/Thrift/API/HiveClient2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use warnings;

use Moo;
use Carp;
use Scalar::Util qw( blessed );

use Thrift;
use Thrift::Socket;
Expand Down Expand Up @@ -131,7 +132,7 @@ has _session => (
is => 'rwp',
isa => sub {
die "Session isn't a Thrift::API::HiveClient2::TOpenSessionResp"
if !$_[0]->isa('Thrift::API::HiveClient2::TOpenSessionResp') },
if ! blessed($_[0]) || !$_[0]->isa('Thrift::API::HiveClient2::TOpenSessionResp') },
lazy => 1,
builder => '_build_session',
);
Expand Down Expand Up @@ -164,7 +165,7 @@ has _session_handle => (
is => 'rwp',
isa => sub {
die "Session handle isn't a Thrift::API::HiveClient2::TSessionHandle"
if !$_[0]->isa('Thrift::API::HiveClient2::TSessionHandle') },
if ! blessed($_[0]) || !$_[0]->isa('Thrift::API::HiveClient2::TSessionHandle') },
lazy => 1,
builder => '_build_session_handle',
);
Expand All @@ -178,7 +179,7 @@ has _operation => (
is => "rwp",
isa => sub {
die "Operation isn't a Thrift::API::HiveClient2::TExecuteStatementResp"
if defined $_[0] && !$_[0]->isa('Thrift::API::HiveClient2::TExecuteStatementResp') },
if defined $_[0] && ( ! blessed($_[0]) || !$_[0]->isa('Thrift::API::HiveClient2::TExecuteStatementResp') ) },
lazy => 1,
);

Expand All @@ -187,7 +188,7 @@ has _operation_handle => (
isa => sub {
die
"Operation handle isn't a Thrift::API::HiveClient2::TOperationHandle"
if defined $_[0] && !$_[0]->isa('Thrift::API::HiveClient2::TOperationHandle');
if defined $_[0] && ( ! blessed($_[0]) || !$_[0]->isa('Thrift::API::HiveClient2::TOperationHandle') );
},
lazy => 1,
);
Expand Down