10
10
import pandas as pd
11
11
from pandas .compat import PY3 , string_types , text_type
12
12
import pandas .core .common as com
13
+ from pandas .formats .printing import pprint_thing , pprint_thing_encoded
13
14
import pandas .lib as lib
14
15
from pandas .core .base import StringMixin
15
16
from pandas .computation .common import _ensure_decoded , _result_type_many
@@ -62,7 +63,7 @@ def local_name(self):
62
63
return self .name .replace (_LOCAL_TAG , '' )
63
64
64
65
def __unicode__ (self ):
65
- return com . pprint_thing (self .name )
66
+ return pprint_thing (self .name )
66
67
67
68
def __call__ (self , * args , ** kwargs ):
68
69
return self .value
@@ -118,9 +119,9 @@ def type(self):
118
119
119
120
@property
120
121
def raw (self ):
121
- return com . pprint_thing ('{0}(name={1!r}, type={2})'
122
- '' .format (self .__class__ .__name__ , self .name ,
123
- self .type ))
122
+ return pprint_thing ('{0}(name={1!r}, type={2})'
123
+ '' .format (self .__class__ .__name__ , self .name ,
124
+ self .type ))
124
125
125
126
@property
126
127
def is_datetime (self ):
@@ -186,9 +187,9 @@ def __unicode__(self):
186
187
"""Print a generic n-ary operator and its operands using infix
187
188
notation"""
188
189
# recurse over the operands
189
- parened = ('({0})' .format (com . pprint_thing (opr ))
190
+ parened = ('({0})' .format (pprint_thing (opr ))
190
191
for opr in self .operands )
191
- return com . pprint_thing (' {0} ' .format (self .op ).join (parened ))
192
+ return pprint_thing (' {0} ' .format (self .op ).join (parened ))
192
193
193
194
@property
194
195
def return_type (self ):
@@ -390,10 +391,10 @@ def convert_values(self):
390
391
"""
391
392
def stringify (value ):
392
393
if self .encoding is not None :
393
- encoder = partial (com . pprint_thing_encoded ,
394
+ encoder = partial (pprint_thing_encoded ,
394
395
encoding = self .encoding )
395
396
else :
396
- encoder = com . pprint_thing
397
+ encoder = pprint_thing
397
398
return encoder (value )
398
399
399
400
lhs , rhs = self .lhs , self .rhs
@@ -491,7 +492,7 @@ def __call__(self, env):
491
492
return self .func (operand )
492
493
493
494
def __unicode__ (self ):
494
- return com . pprint_thing ('{0}({1})' .format (self .op , self .operand ))
495
+ return pprint_thing ('{0}({1})' .format (self .op , self .operand ))
495
496
496
497
@property
497
498
def return_type (self ):
@@ -516,7 +517,7 @@ def __call__(self, env):
516
517
517
518
def __unicode__ (self ):
518
519
operands = map (str , self .operands )
519
- return com . pprint_thing ('{0}({1})' .format (self .op , ',' .join (operands )))
520
+ return pprint_thing ('{0}({1})' .format (self .op , ',' .join (operands )))
520
521
521
522
522
523
class FuncNode (object ):
0 commit comments