opensearch-project / opensearch-php

Official PHP Client for OpenSearch
Other
99 stars 56 forks source link

format on Sql #156

Closed archipelweb closed 1 year ago

archipelweb commented 1 year ago

Description

Allow to use a format parameter for sql plugin

Issues Resolved

155

dblock commented 1 year ago

Please amend the commit with passing DCO (git commit -s --amend).

Is there some kind of test we can write to exercise this?

archipelweb commented 1 year ago

We done the commit

to validate this modification:

/*
load client with credentials
*/
$request="SELECT * FROM `my-index`";
$params=['query' => $request];
$result = $client->sql()->query($params);

the return:

"schema": [
    {
        "name": "date",
        "type": "text"
    }
]
"datarows": [
    [
        "2023-05-31 09:18:38",
    ]
],
"total": 1,
"size": 1,
"status": 200
dblock commented 1 year ago
codecov[bot] commented 1 year ago

Codecov Report

Merging #156 (0eb1482) into main (8b6cdbc) will not change coverage. The diff coverage is 0.00%.

@@            Coverage Diff            @@
##               main     #156   +/-   ##
=========================================
  Coverage     24.14%   24.14%           
  Complexity     1937     1937           
=========================================
  Files           246      246           
  Lines          6863     6863           
=========================================
  Hits           1657     1657           
  Misses         5206     5206           
Impacted Files Coverage Δ
src/OpenSearch/Endpoints/Sql/Query.php 66.66% <0.00%> (ø)
archipelweb commented 1 year ago

Sorry dblock, We are some developers not used to the world of open source contributions... Initially, we only just wanted to suggest this small improvement, by showing you what it could bring, and we have try to provide you some details to help you (as we can) to integrate it... But right now, we can't do much better, sorry.. Is it not possible for you to "properly" integrate this small evolution (if you judge it relevant) into the project, by yourself ? Thanks you.

dblock commented 1 year ago

I think it's a great small change! Without tests the feature can break quietly, and I am sure you wouldn't like that suddenly a future release gets cut and your added feature is broken! If you have time to finish this PR, thank you, if not let's hope someone picks it up from where you left it off. Thanks for getting it this far.

CSalih commented 1 year ago

I was so kind and have extended it with tests in a new PR #161. This is a nice feature to have, thank you @archipelweb for beginning this feature.

archipelweb commented 1 year ago

I was so kind and have extended it with tests

Yeah, @CSalih that's really kind ! Tank you very much for this. We are grateful !

dblock commented 1 year ago

Closing after https://github.com/opensearch-project/opensearch-php/pull/161 was merged. Thank @archipelweb and @CSalih for contributing!