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

feat: handling data inconsistency! #339

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dags/analyzer_helper/discourse/transform_raw_members.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def transform_member(self, member: dict) -> dict:
"left_at": None,
"joined_at": self.converter.from_date_string(member.get("joined_at")),
"options": {
"name": member["name"],
"name": member["name"] if member["name"] is not "null" else None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix incorrect string comparison operator

The use of is not for string comparison is incorrect and can lead to unexpected behavior due to Python's string interning. Use != for value comparison instead.

-                "name": member["name"] if member["name"] is not "null" else None,
+                "name": member["name"] if member["name"] != "null" else None,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"name": member["name"] if member["name"] is not "null" else None,
"name": member["name"] if member["name"] != "null" else None,
🧰 Tools
🪛 Ruff (0.8.2)

56-56: Use != to compare constant literals

Replace is not with !=

(F632)

"username": member["username"],
"avatar": avatar,
},
Expand Down
Loading