当前位置: 首页>>代码示例>>Python>>正文


Python Babe.typedetect方法代码示例

本文整理汇总了Python中pybabe.Babe.typedetect方法的典型用法代码示例。如果您正苦于以下问题:Python Babe.typedetect方法的具体用法?Python Babe.typedetect怎么用?Python Babe.typedetect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pybabe.Babe的用法示例。

在下文中一共展示了Babe.typedetect方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_pushsqlite_partition

# 需要导入模块: from pybabe import Babe [as 别名]
# 或者: from pybabe.Babe import typedetect [as 别名]
    def test_pushsqlite_partition(self):
        a = Babe().pull(string=self.s, format='csv')
        a = a.typedetect()
        a.push_sql(table='test_table', database_kind='sqlite', database='test.sqlite', drop_table = True, create_table=True)

        a = Babe().pull(string=self.s2, format='csv')
        a = a.typedetect()
        a = a.partition(field='id')
        a.push_sql(table='test_table', database_kind='sqlite', database='test.sqlite', delete_partition=True)

        b = Babe().pull_sql(database_kind='sqlite', database='test.sqlite', table='test_table')
        b = b.sort(field="id")
        self.assertEquals(b.to_string(), self.sr)
开发者ID:fdouetteau,项目名称:PyBabe,代码行数:15,代码来源:test_sql.py


示例2: test_pushsqlite_partition

# 需要导入模块: from pybabe import Babe [as 别名]
# 或者: from pybabe.Babe import typedetect [as 别名]
    def test_pushsqlite_partition(self):
        a = Babe().pull(stream=StringIO(self.s), format='csv')
        a = a.typedetect()
        a.push_sql(table='test_table', database_kind='sqlite', database='test.sqlite', drop_table = True, create_table=True)

        a = Babe().pull(stream=StringIO(self.s2), format='csv')
        a = a.typedetect()
        a = a.partition(field='id')
        a.push_sql(table='test_table', database_kind='sqlite', database='test.sqlite', delete_partition=True)

        b = Babe().pull_sql(database_kind='sqlite', database='test.sqlite', table='test_table')
        b = b.sort(field="id")
        buf = StringIO()
        b.push(stream=buf, format='csv', delimiter=',')
        self.assertEquals(buf.getvalue(), self.sr)
开发者ID:nizox,项目名称:PyBabe,代码行数:17,代码来源:tests.py


示例3: test_bulk

# 需要导入模块: from pybabe import Babe [as 别名]
# 或者: from pybabe.Babe import typedetect [as 别名]
 def test_bulk(self):
     a = Babe().pull(stream=StringIO(self.s), format="csv")
     a = a.typedetect()
     a = a.bulkMapTo(lambda list: [[sum([r.a for r in list])]] * len(list),
                     bulk_size=2,
                     insert_fields=["b"])
     self.assertEquals(a.to_string(), self.s2)
开发者ID:IsCoolEntertainment,项目名称:PyBabe,代码行数:9,代码来源:test_transform.py


示例4: test_twitter

# 需要导入模块: from pybabe import Babe [as 别名]
# 或者: from pybabe.Babe import typedetect [as 别名]
 def test_twitter(self):
     a = Babe().pull_twitter()
     a = a.filterColumns(keep_fields=
     ["author_name", "author_id", "author_screen_name", "created_at", "hashtags", "text", "in_reply_to_status_id_str"])
     a = a.typedetect()
     buf = StringIO()
     a.push(stream=buf, format='csv')
开发者ID:nizox,项目名称:PyBabe,代码行数:9,代码来源:tests.py


示例5: test_vectorwise

# 需要导入模块: from pybabe import Babe [as 别名]
# 或者: from pybabe.Babe import typedetect [as 别名]
 def test_vectorwise(self):
     a = Babe().pull(stream=StringIO(self.s), format='csv')
     a = a.typedetect()
     a.push_sql(table='test_table', database_kind='vectorwise', database='pybabe_test', drop_table = True, create_table=True)
     b = Babe().pull_sql(database_kind='vectorwise', database='pybabe_test', table='test_table')
     buf = StringIO()
     b.push(stream=buf, format='csv', delimiter=',')
     self.assertEquals(buf.getvalue(), self.s)
开发者ID:nizox,项目名称:PyBabe,代码行数:10,代码来源:tests.py


示例6: test_pushpull

# 需要导入模块: from pybabe import Babe [as 别名]
# 或者: from pybabe.Babe import typedetect [as 别名]
 def test_pushpull(self):
     a  = Babe().pull(stream=StringIO(self.s2), format='csv', primary_key='rown')
     a = a.typedetect()
     a.push_mongo(db='pybabe_test',collection='test_pushpull', drop_collection=True)
     b = Babe().pull_mongo(db="pybabe_test", fields=['rown', 'f', 's'], collection='test_pushpull')
     buf = StringIO()
     b.push(stream=buf, format='csv')
     self.assertEquals(buf.getvalue(), self.s2)      
开发者ID:nizox,项目名称:PyBabe,代码行数:10,代码来源:tests.py


示例7: test_pushsqlite

# 需要导入模块: from pybabe import Babe [as 别名]
# 或者: from pybabe.Babe import typedetect [as 别名]
 def test_pushsqlite(self):
     a = Babe().pull(string=self.s, format='csv')
     a = a.typedetect()
     a.push_sql(table='test_table',
                database_kind='sqlite',
                database='tests/files/test.sqlite',
                drop_table=True,
                create_table=True)
     b = Babe().pull_sql(database_kind='sqlite',
                         database='tests/files/test.sqlite',
                         table='test_table')
     self.assertEquals(b.to_string(), self.s)
开发者ID:IsCoolEntertainment,项目名称:PyBabe,代码行数:14,代码来源:test_sql.py


示例8: test_vectorwise

# 需要导入模块: from pybabe import Babe [as 别名]
# 或者: from pybabe.Babe import typedetect [as 别名]
 def test_vectorwise(self):
     a = Babe().pull(string=self.s,
                     format='csv')
     a = a.typedetect()
     a.push_sql(table='test_table',
                database_kind='vectorwise',
                database='pybabe_test',
                drop_table=True,
                create_table=True)
     b = Babe().pull_sql(database_kind='vectorwise',
                         database='pybabe_test',
                         table='test_table')
     self.assertEquals(b.to_string(), self.s)
开发者ID:IsCoolEntertainment,项目名称:PyBabe,代码行数:15,代码来源:test_sql.py


示例9: test_pushpull

# 需要导入模块: from pybabe import Babe [as 别名]
# 或者: from pybabe.Babe import typedetect [as 别名]
 def test_pushpull(self):
     a = Babe().pull(string=self.s2, format="csv", primary_key="rown")
     a = a.typedetect()
     a.push_mongo(db="pybabe_test", collection="test_pushpull", drop_collection=True)
     b = Babe().pull_mongo(db="pybabe_test", fields=["rown", "f", "s"], collection="test_pushpull")
     self.assertEquals(b.to_string(), self.s2)
开发者ID:IsCoolEntertainment,项目名称:PyBabe,代码行数:8,代码来源:test_mongo.py


示例10: test_push

# 需要导入模块: from pybabe import Babe [as 别名]
# 或者: from pybabe.Babe import typedetect [as 别名]
 def test_push(self):
     a = Babe().pull(string=self.s1, format="csv", primary_key="rown")
     a = a.typedetect()
     a.push_mongo(db="pybabe_test", collection="test_push")
开发者ID:IsCoolEntertainment,项目名称:PyBabe,代码行数:6,代码来源:test_mongo.py


示例11: test_push

# 需要导入模块: from pybabe import Babe [as 别名]
# 或者: from pybabe.Babe import typedetect [as 别名]
 def test_push(self):
     a  = Babe().pull(string=self.s1, format='csv', primary_key='rown')
     a = a.typedetect()
     a.push_mongo(db='pybabe_test',collection='test_push')
开发者ID:fdouetteau,项目名称:PyBabe,代码行数:6,代码来源:test_mongo.py


示例12: test_pushpull

# 需要导入模块: from pybabe import Babe [as 别名]
# 或者: from pybabe.Babe import typedetect [as 别名]
 def test_pushpull(self):
     a  = Babe().pull(string=self.s2, format='csv', primary_key='rown')
     a = a.typedetect()
     a.push_mongo(db='pybabe_test',collection='test_pushpull', drop_collection=True)
     b = Babe().pull_mongo(db="pybabe_test", fields=['rown', 'f', 's'], collection='test_pushpull')
     self.assertEquals(b.to_string(), self.s2)
开发者ID:fdouetteau,项目名称:PyBabe,代码行数:8,代码来源:test_mongo.py



注:本文中的pybabe.Babe.typedetect方法示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。