Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create_tag doesn't process case when tags is int #240

Closed
s-medvedev opened this issue Nov 13, 2018 · 1 comment
Closed

create_tag doesn't process case when tags is int #240

s-medvedev opened this issue Nov 13, 2018 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@s-medvedev
Copy link
Contributor

Impact:
Some post doesn't converted (~10 items)

STR:
Convert some posts (for example author mmalikov and permlink qmycpexxiwp8zshuupsogb2w3wshocfuqvgh7s3kannchj) from Golos to Cyberway database

Actual result:

("'int' object is not iterable",)
Traceback (most recent call last):
  File "./convert_publish.py", line 111, in convert_posts
    tags = create_tags(doc["json_metadata"]["tags"])
  File "./convert_publish.py", line 16, in create_tags
    for tag in metadata_tags or []:
TypeError: 'int' object is not iterable

Expected result:
Post converted successfully

Additional info:

{'_id': ObjectId('d2760f4fa659276111a1cb38'), 'abs_rshares': 0, 'active': datetime.datetime(2018, 4, 10, 0, 39, 51), 'allow_curation_rewards': True, 'allow_replies': True, 'allow_votes': True, 'author': 'mmalikov', 'block_num': 15643827, 'body': '\n            <img src="http://www.viboard.me/dist/banner.png" alt="QmYCPEXXiwp8zSHuUPsogb2W3wShoCFuqVGH7s3KAnNchj">', 'cashout_time': datetime.datetime(2106, 2, 7, 6, 28, 15), 'category': 'videotest', 'children': 0, 'children_abs_rshares': 0, 'children_rshares2': 0, 'created': datetime.datetime(2018, 4, 10, 0, 39, 51), 'depth': 0, 'json_metadata': {'tags': 3}, 'last_payout': datetime.datetime(2018, 4, 17, 0, 39, 51), 'last_update': datetime.datetime(2018, 4, 10, 0, 39, 51), 'max_accepted_payout_symbol': 'GBG', 'max_accepted_payout_value': 1000000.0, 'max_cashout_time': datetime.datetime(2106, 2, 7, 6, 28, 15), 'mode': 'archived', 'net_rshares': 0, 'net_votes': 3, 'parent_author': '', 'parent_permlink': 'videotest', 'percent_steem_dollars': 10000, 'permlink': 'qmycpexxiwp8zshuupsogb2w3wshocfuqvgh7s3kannchj', 'removed': False, 'reward_weight': 10000, 'root_comment': ObjectId('d2760f4fa659276111a1cb38'), 'title': 'LEGOs', 'total_vote_weight': 0, 'vote_rshares': 0, 'author_gbg_payout_symbol': 'GBG', 'author_gbg_payout_value': 0.0, 'author_gests_payout_symbol': 'GESTS', 'author_gests_payout_value': 0.0, 'author_golos_payout_symbol': 'GOLOS', 'author_golos_payout_value': 0.0, 'author_rewards': 0, 'beneficiary_gests_payout_symbol': 'GESTS', 'beneficiary_gests_payout_value': 0.0, 'beneficiary_payout_symbol': 'GBG', 'beneficiary_payout_value': 0.0, 'curator_gests_payout_symbol': 'GESTS', 'curator_gests_payout_value': 0.0, 'curator_payout_symbol': 'GBG', 'curator_payout_value': 0.0, 'total_payout_symbol': 'GBG', 'total_payout_value': 0.0}
("'int' object is not iterable",)
Traceback (most recent call last):
  File "./convert_publish.py", line 111, in convert_posts
    tags = create_tags(doc["json_metadata"]["tags"])
  File "./convert_publish.py", line 16, in create_tags
    for tag in metadata_tags or []:
TypeError: 'int' object is not iterable
@s-medvedev s-medvedev added this to the Sprint-nov-12 milestone Nov 13, 2018
@s-medvedev s-medvedev added the bug Something isn't working label Nov 13, 2018
@adedkov adedkov self-assigned this Nov 14, 2018
@adedkov
Copy link
Contributor

adedkov commented Nov 14, 2018

#243

@adedkov adedkov closed this as completed Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants