Skip to content

refactor(py): sync optional file payload default behavior - #418

Closed
chyroc wants to merge 2 commits into
mainfrom
refactor/remove-files-expr-config-sync
Closed

refactor(py): sync optional file payload default behavior#418
chyroc wants to merge 2 commits into
mainfrom
refactor/remove-files-expr-config-sync

Conversation

@chyroc

@chyroc chyroc commented Feb 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Sync generated SDK output after coze-sdk-gen removed files_expr mapping support.
  • Keep equivalent behavior for optional single-file payloads by checking file is not None before constructing files.
  • Updated generated file:
    • cozepy/audio/voiceprint_groups/features/__init__.py
  • Added tests to cover the new optional-file branch in both sync and async clients:
    • tests/test_audio_voiceprint_groups_features.py

Upstream

Validation

  • ./scripts/genpy.sh --output-sdk /tmp/coze-py-DfIlej --ci-check (executed in codegen workflow)
  • poetry run pytest tests/test_audio_voiceprint_groups_features.py

@chyroc chyroc added the chore Project maintenance work not related to features and bug fixes label Feb 26, 2026
@coderabbitai

coderabbitai Bot commented Feb 26, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The PR modifies file validation in VoiceprintGroupsFeaturesClient's update methods (both sync and async variants) by changing from a falsy check to an explicit None check, allowing empty/falsy file values to proceed through file attachment logic instead of being skipped.

Changes

Cohort / File(s) Summary
File Validation Logic
cozepy/audio/voiceprint_groups/features/__init__.py
Changed file presence guard from truthiness check (if file) to explicit None check (if file is not None) in both VoiceprintGroupsFeaturesClient.update and AsyncVoiceprintGroupsFeaturesClient.update methods.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested labels

chore

Poem

A rabbit checks with care so true,
Not just for presence, but what's new—
None means nothing, falsy means vague,
Being precise wins every plague! 🐰✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: refactoring optional file payload handling to sync behavior with upstream SDK generator updates.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/remove-files-expr-config-sync

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Feb 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.15%. Comparing base (3bd04ea) to head (e0a54ed).

@@            Coverage Diff             @@
##             main     #418      +/-   ##
==========================================
+ Coverage   91.75%   92.15%   +0.39%     
==========================================
  Files         105      106       +1     
  Lines        9542     9567      +25     
==========================================
+ Hits         8755     8816      +61     
+ Misses        787      751      -36     
Files with missing lines Coverage Δ
...ozepy/audio/voiceprint_groups/features/__init__.py 66.66% <100.00%> (+16.09%) ⬆️
tests/test_audio_voiceprint_groups_features.py 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chyroc

chyroc commented Feb 26, 2026

Copy link
Copy Markdown
Collaborator Author

Closing per request: upstream change is not needed.

@chyroc chyroc closed this Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Project maintenance work not related to features and bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant