Skip to content

Migrate EMR services to new request parsing/response serialization#9973

Merged
bpandola merged 3 commits intogetmoto:masterfrom
bpandola:emrcontainers-updates
Apr 12, 2026
Merged

Migrate EMR services to new request parsing/response serialization#9973
bpandola merged 3 commits intogetmoto:masterfrom
bpandola:emrcontainers-updates

Conversation

@bpandola
Copy link
Copy Markdown
Collaborator

This PR migrates the EMR Containers and EMR Serverless backends to the new request parsing/response serialization:

  • Response Handling: Migrated from manual JSON serialization to ActionResult helpers
  • Model Class Renames: FakeClusterVirtualCluster, FakeJobJobRun (align with AWS naming)
  • Removed Manual Serialization: Removed __iter__ and to_dict() methods; model now returns objects directly
  • Pagination: Removed custom paginated_list function, now handled by core PaginatedResult helper
  • Date/Time Handling: Replaced string formatted dates in the model with native Python datetime objects

Also adds a fix for the core data loader to ensure that Moto "extras" can still be found when Moto's data directory differs from Botocore's (e.g. emr-containersemrcontainers).

Closes #9922
Supersedes and Closes #9923

Botocore's data directory allows hyphens, but Moto's core directory consists
of Python modules (which cannot contain hyphens) alongside data files.

Here we wrap the Botocore method for finding extras and inject the Moto
directory name before calling the super class.  This allows for loading
the main service specification from Botocore and the extras from Moto
when the directory names differ (e.g. `emr-containers` -> `emrcontainers`).
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.18%. Comparing base (ced3bb1) to head (a134b52).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9973      +/-   ##
==========================================
- Coverage   93.19%   93.18%   -0.01%     
==========================================
  Files        1321     1321              
  Lines      120294   120217      -77     
==========================================
- Hits       112102   112022      -80     
- Misses       8192     8195       +3     
Flag Coverage Δ
servertests 28.97% <43.35%> (-0.01%) ⬇️
unittests 93.15% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bpandola bpandola merged commit ce70a60 into getmoto:master Apr 12, 2026
81 checks passed
@bpandola bpandola deleted the emrcontainers-updates branch April 12, 2026 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: pagination emits next_token at end-of-list, causing extra empty page and potential client loops

1 participant