Skip to content

Commit

Permalink
Use ChoiceType for PandasDatasource.format - see apache#3302
Browse files Browse the repository at this point in the history
  • Loading branch information
rhunwicks committed Oct 1, 2017
1 parent ce7ff69 commit c69a161
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion contrib/connectors/pandas/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,12 @@ def data(self):

@property
def pandas_read_method(self):
return getattr(pd, 'read_{obj.format.code}'.format(obj=self))
try:
# The format is a Choice object
format = self.format.code
except AttributeError:
format = self.format
return getattr(pd, 'read_{format}'.format(format=format))

@property
def pandas_read_parameters(self):
Expand Down

0 comments on commit c69a161

Please sign in to comment.