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

refactor: Restrict heterogeneous ConfidenceValue lists #86

Merged
merged 2 commits into from
Apr 5, 2024

Conversation

fabriziodemaria
Copy link
Member

Exploratory PR not meant for merging yet.

@fabriziodemaria fabriziodemaria changed the title Restrict heterogeneous ConfidenceValue lists refactor: Restrict heterogeneous ConfidenceValue lists Apr 4, 2024
Comment on lines +33 to +35
public init(valueList: [ConfidenceValue]) {
self.value = .list(valueList.map { $0.value })
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Here we could make this private (or delete this), but then the problem is how to convert heterogeneous Values from OpenFeature

Copy link
Member

Choose a reason for hiding this comment

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

I think it would be nicer to have multiple inits:

public init(valueList: [String]) {}
public init(valueList: [Int64]) {}
public init(valueList: [Bool]) {}
...

Copy link
Member

Choose a reason for hiding this comment

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

oh, you had that just below :D

@fabriziodemaria fabriziodemaria marked this pull request as ready for review April 5, 2024 07:35
@fabriziodemaria fabriziodemaria merged commit 839fd8c into confidence-value Apr 5, 2024
1 of 2 checks passed
fabriziodemaria added a commit that referenced this pull request Apr 9, 2024
* Add ConfidenceValue

* Add ConfidenceValueTests

* Remove DateComponents

* Simplify and finalize ConfidenceValue

* Test fix

* Update demo app

* Variable renaming

* ConfidenceValue is only Codable

* Add Confidence-OF converstions

* refactor: Restrict heterogeneous ConfidenceValue lists (#86)

* Change ConfidenceValue constructors for more control

* Setup for list restrictions

* Remove unused converters

* Change time-related arg labels

* Fix date format

* Explicit UTC settings and TZ tests

* Best effort convert OF lists

* Rename bool to boolean

* Rename TZ offset from timestamps

* Add swiftpm back
nickybondarenko pushed a commit that referenced this pull request Apr 10, 2024
* Add ConfidenceValue

* Add ConfidenceValueTests

* Remove DateComponents

* Simplify and finalize ConfidenceValue

* Test fix

* Update demo app

* Variable renaming

* ConfidenceValue is only Codable

* Add Confidence-OF converstions

* refactor: Restrict heterogeneous ConfidenceValue lists (#86)

* Change ConfidenceValue constructors for more control

* Setup for list restrictions

* Remove unused converters

* Change time-related arg labels

* Fix date format

* Explicit UTC settings and TZ tests

* Best effort convert OF lists

* Rename bool to boolean

* Rename TZ offset from timestamps

* Add swiftpm back
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants