Repository: arrow-py/arrow

Issue:
Arrow 1.1.1 doesn't support get from decimal, but 0.15.2 support
<!--
Thanks for taking the time to submit this bug report.

Please provide us with a detailed description of the bug and a bit of information about your system.
-->

## Issue Description

Arrow 1.1.1 doesn't support get from decimal, but 0.15.2 support

![image](https://user-images.githubusercontent.com/5227779/132082537-95bb3257-ab3f-4391-8717-05fea44142ca.png)


<!--
Replace this comment block with a description of the bug.

Be sure to include details such as the expected and actual outcomes.
-->

OS: Darwin Kernel Version 20.3.0
OS: Centos7
## System Info

- 🖥  **OS name and version**: <!-- Replace with OS name and version (e.g. macOS 10.15.7). -->
- 🐍  **Python version**: <!-- Replace with Python version (e.g. Python 3.8.5). -->
- 🏹  **Arrow version**: <!-- Replace with Arrow version. Run arrow.__version__ to find out! -->


Discussion:
codecov[bot]: # [Codecov](https://codecov.io/gh/arrow-py/arrow/pull/1035?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arrow-py) Report
> Merging [#1035](https://codecov.io/gh/arrow-py/arrow/pull/1035?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arrow-py) (728746b) into [master](https://codecov.io/gh/arrow-py/arrow/commit/80e5947de29b49c52c84c7bce9dedbf5532606fa?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arrow-py) (80e5947) will **not change** coverage.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/arrow-py/arrow/pull/1035/graphs/tree.svg?width=650&height=150&src=pr&token=4EkGnFsIGn&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arrow-py)](https://codecov.io/gh/arrow-py/arrow/pull/1035?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arrow-py)

```diff
@@            Coverage Diff            @@
##            master     #1035   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines         2160      2163    +3     
  Branches       341       342    +1     
=========================================
+ Hits          2160      2163    +3     
```


| [Impacted Files](https://codecov.io/gh/arrow-py/arrow/pull/1035?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arrow-py) | Coverage Δ | |
|---|---|---|
| [arrow/factory.py](https://codecov.io/gh/arrow-py/arrow/pull/1035/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arrow-py#diff-YXJyb3cvZmFjdG9yeS5weQ==) | `100.00% <100.00%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/arrow-py/arrow/pull/1035?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arrow-py).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arrow-py)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/arrow-py/arrow/pull/1035?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arrow-py). Last update [80e5947...728746b](https://codecov.io/gh/arrow-py/arrow/pull/1035?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arrow-py). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arrow-py).


Patch:
diff --git a/arrow/factory.py b/arrow/factory.py
index 5787dcf..aad4af8 100644
--- a/arrow/factory.py
+++ b/arrow/factory.py
@@ -9,6 +9,7 @@ construction scenarios.
 import calendar
 from datetime import date, datetime
 from datetime import tzinfo as dt_tzinfo
+from decimal import Decimal
 from time import struct_time
 from typing import Any, List, Optional, Tuple, Type, Union, overload
 
@@ -218,6 +219,8 @@ class ArrowFactory:
 
         if arg_count == 1:
             arg = args[0]
+            if isinstance(arg, Decimal):
+                arg = float(arg)
 
             # (None) -> raises an exception
             if arg is None:


Test patch:
diff --git a/tests/test_factory.py b/tests/test_factory.py
index 4bb81e8..53bba20 100644
--- a/tests/test_factory.py
+++ b/tests/test_factory.py
@@ -1,5 +1,6 @@
 import time
 from datetime import date, datetime
+from decimal import Decimal
 
 import pytest
 from dateutil import tz
@@ -263,6 +264,13 @@ class TestGet:
         with pytest.raises(TypeError):
             self.factory.get(True)
 
+    def test_one_arg_decimal(self):
+        result = self.factory.get(Decimal(1577836800.26843))
+
+        assert result._datetime == datetime(
+            2020, 1, 1, 0, 0, 0, 268430, tzinfo=tz.tzutc()
+        )
+
     def test_two_args_datetime_tzinfo(self):
 
         result = self.factory.get(datetime(2013, 1, 1), tz.gettz("US/Pacific"))