pyvider 2024-11-28
Implemented RawState system for Terraform state marshaling with JSON support
9 files · 497+ · 73-

Implemented RawState for Terraform state marshaling

1 file changed
  • state.py RawState dataclass wrapping protobuf RawState with JSON and flatmap support, unmarshal methods, and error handling (140 lines)
  • Added state.py implementing RawState dataclass with JSON and flatmap state data support instantiate behavioral
    1 file
    • state.py
  • Implements unmarshal() and unmarshal_with_opts() methods for converting state into typed values with ValueFromJSONOpts for unknown value handling instantiate behavioral
    1 file
    • state.py
  • Added UnknownRawStateTypeError for missing data detection and clear error for flatmap states requiring Terraform 0.12+ harden internal
    1 file
    • state.py

Added comprehensive state marshal/unmarshal tests

1 file changed
  • test_tfprotov6_state.py Comprehensive state marshal/unmarshal tests (166 lines)
  • Added test_tfprotov6_state.py with comprehensive state marshal/unmarshal tests covering JSON, flatmap, and error cases qualify behavioral
    1 file
    • test_tfprotov6_state.py

Enhanced Value with JSON support and improved Map validation

4 files changed
  • value.py Enhanced with from_json() support (104+ lines added)
  • map.py Improved validation (96 lines changed)
  • simple.py Additional type checks (20+ lines)
  • schema.py Trailing whitespace cleanup
  • Enhanced tftypes Value with from_json() support for state deserialization streamline internal
    1 file
    • value.py
  • Improved Map type validation and simple type checks streamline internal
    2 files
    • map.py
    • simple.py

Added requirements files for dependency management

3 files changed
  • base.txt Base dependencies
  • dev.txt Development dependencies
  • test.txt Test dependencies
  • Added requirements files for base, dev, and test dependencies baseline internal
    3 files
    • base.txt
    • dev.txt
    • test.txt