예제 #1
0
    def test_join_things(self):
        fields = ["url", "sr_id"]
        link = make_link(thing_id=1, timestamp=100.01, url="foo", sr_id=10)
        dump = make_pg_dump(fields, link)
        stdin = StringIO(dump)
        stdout = StringIO()
        mr_tools.join_things(fields, fd=stdin, out=stdout, err=StringIO())

        self.assertEqual(stdout.getvalue().strip(), "1 link 1 0 f f 100.01 foo 10".replace(" ", "\t"))
예제 #2
0
파일: mr_top.py 프로젝트: zeantsoi/reddit
 def join_things(self):
     fields = []
     defaults = {}
     for k, typ in self.fields.iteritems():
         fields.append(k)
         if typ is int:
             defaults[k] = 0
         elif typ is str:
             defaults[k] = ""
     mr_tools.join_things(
         fields, fd=self.fd, out=self.out, err=self.err, defaults=defaults
     )
예제 #3
0
def join_comments():
    return mr_tools.join_things(('link_id',))
예제 #4
0
파일: mr_domains.py 프로젝트: 3river/reddit
def join_links():
    mr_tools.join_things(('url',))
예제 #5
0
파일: mr_top.py 프로젝트: pra85/reddit
def join_things(thing_type):
    mr_tools.join_things(data_fields_by_name[thing_type].keys())
예제 #6
0
def join_comments():
    join_things(('author_id',))
예제 #7
0
def join_things(thing_type):
    mr_tools.join_things(data_fields_by_name[thing_type].keys())
예제 #8
0
def join_links():
    join_things(("author_id", "sr_id"))
예제 #9
0
def join_links():
    mr_tools.join_things(('author_id',))
예제 #10
0
def join_links():
    mr_tools.join_things(('url', ))
예제 #11
0
def join_things():
    mr_tools.join_things(('url', 'sr_id', 'author_id'))
예제 #12
0
def join_links():
    mr_tools.join_things(('author_id', ))
예제 #13
0
def join_comments():
    return mr_tools.join_things(('link_id', ))
예제 #14
0
def join_comments():
    join_things(('author_id', ))
예제 #15
0
def join_links():
    join_things(('author_id', 'sr_id'))
예제 #16
0
def join_things():
    mr_tools.join_things(('url', 'sr_id', 'author_id'))
예제 #17
0
파일: mr_top.py 프로젝트: 3river/reddit
def join_links():
    mr_tools.join_things(('url', 'sr_id'))
예제 #18
0
def join_links():
    join_things(('author_id', 'sr_id'))
예제 #19
0
def join_comments():
    join_things(("author_id",))
예제 #20
0
def join_links():
    mr_tools.join_things(('url', 'sr_id'))